Bladeren bron

innoextract: add package (#7947)

* innoextract: add package

* fix static deps

* bzip2: remove os.ln on windows

* boost: fix syslinks when building upstream binary package
star9029 2 weken geleden
bovenliggende
commit
96ccc78338
3 gewijzigde bestanden met toevoegingen van 44 en 7 verwijderingen
  1. 6 6
      packages/b/boost/xmake.lua
  2. 1 1
      packages/b/bzip2/port/xmake.lua
  3. 37 0
      packages/i/innoextract/xmake.lua

+ 6 - 6
packages/b/boost/xmake.lua

@@ -64,12 +64,6 @@ package("boost")
         add_extsources("brew::boost")
     end
 
-    if is_plat("linux", "bsd") then
-        add_syslinks("pthread", "dl")
-    elseif is_plat("windows", "mingw") then
-        add_syslinks("ntdll", "shell32", "advapi32", "user32", "ws2_32")
-    end
-
     on_fetch("fetch")
 
     if on_check then
@@ -83,6 +77,12 @@ package("boost")
     end
 
     on_load(function (package)
+        if package:is_plat("linux", "bsd") then
+            package:add("syslinks", "pthread", "dl")
+        elseif package:is_plat("windows", "mingw") then
+            package:add("syslinks", "ntdll", "shell32", "advapi32", "user32", "ws2_32")
+        end
+
         local version = package:version()
         if package:config("cmake") and version:lt("1.86") then
             -- Don't break old version

+ 1 - 1
packages/b/bzip2/port/xmake.lua

@@ -33,7 +33,7 @@ target("bzip2")
 
     after_install(function (target)
         -- copy/link additional executables/scripts (behavior is altered by checking the program name)
-        if target:is_plat("windows", "mingw") then
+        if target:is_plat("windows", "mingw", "msys", "cygwin") then
             local binarydir = path.join(target:installdir(), "bin")
             os.vcp(path.join(binarydir, "bzip2.exe"), path.join(binarydir, "bzcat.exe"))
             os.vcp(path.join(binarydir, "bzip2.exe"), path.join(binarydir, "bunzip2.exe"))

+ 37 - 0
packages/i/innoextract/xmake.lua

@@ -0,0 +1,37 @@
+package("innoextract")
+    set_kind("binary")
+    set_homepage("https://constexpr.org/innoextract/")
+    set_description("A tool to unpack installers created by Inno Setup")
+
+    add_urls("https://github.com/dscharrer/innoextract.git")
+
+    add_versions("2025.02.07", "6e9e34ed0876014fdb46e684103ef8c3605e382e")
+
+    add_deps("cmake")
+    add_deps("xz")
+    add_deps("boost", {configs = {
+        iostreams = true,
+            zlib = true,
+            bzip2 = true,
+        filesystem = true,
+        date_time = true,
+        system = true,
+        program_options = true,
+    }})
+
+    on_install(function (package)
+        local configs = {"-DUSE_STATIC_LIBS=OFF"}
+        table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:is_debug() and "Debug" or "Release"))
+        table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF"))
+        table.insert(configs, "-DUSE_LTO=" .. (package:config("lto") and "ON" or "OFF"))
+
+        table.insert(configs, "-DLZMA_USE_STATIC_LIBS=" .. (package:dep("xz"):config("shared") and "OFF" or "ON"))
+        table.insert(configs, "-DZLIB_USE_STATIC_LIBS=" .. (package:dep("boost"):config("shared") and "OFF" or "ON"))
+        table.insert(configs, "-DBZip2_USE_STATIC_LIBS=" .. (package:dep("bzip2"):config("shared") and "OFF" or "ON"))
+        table.insert(configs, "-DBoost_USE_STATIC_LIBS=" .. (package:dep("zlib"):config("shared") and "OFF" or "ON"))
+        import("package.tools.cmake").install(package, configs)
+    end)
+
+    on_test(function (package)
+        os.vrun("innoextract --help")
+    end)