1+ # Version
2+ haskey (ENV , " HIGHS_RELEASE" ) || error (" The environment variable HIGHS_RELEASE is not defined." )
3+ version = VersionNumber (ENV [" HIGHS_RELEASE" ])
4+ version2 = ENV [" HIGHS_RELEASE" ]
5+ package = " HIGHS"
6+
7+ platforms = [
8+ (" aarch64-apple-darwin" , " lib" , " dylib" ),
9+ (" aarch64-linux-gnu-cxx11" , " lib" , " so" ),
10+ (" aarch64-linux-musl-cxx11" , " lib" , " so" ),
11+ (" aarch64-unknown-freebsd" , " lib" , " so" ),
12+ (" armv6l-linux-gnueabihf-cxx11" , " lib" , " so" ),
13+ (" armv6l-linux-musleabihf-cxx11" , " lib" , " so" ),
14+ (" armv7l-linux-gnueabihf-cxx11" , " lib" , " so" ),
15+ (" armv7l-linux-musleabihf-cxx11" , " lib" , " so" ),
16+ (" i686-linux-gnu-cxx11" , " lib" , " so" ),
17+ (" i686-linux-musl-cxx11" , " lib" , " so" ),
18+ (" i686-w64-mingw32" , " bin" , " dll" ),
19+ (" x86_64-apple-darwin" , " lib" , " dylib" ),
20+ (" x86_64-linux-gnu-cxx11" , " lib" , " so" ),
21+ (" x86_64-linux-musl-cxx11" , " lib" , " so" ),
22+ (" x86_64-unknown-freebsd" , " lib" , " so" ),
23+ (" x86_64-w64-mingw32" , " bin" , " dll" )
24+ ]
25+
26+ for (platform, libdir, ext) in platforms
27+
28+ tarball_name = " $package .v$version .$platform .tar.gz"
29+
30+ if isfile (" products/$(tarball_name) " )
31+ # Unzip the tarball generated by BinaryBuilder.jl
32+ isdir (" products/$platform " ) && rm (" products/$platform " , recursive= true )
33+ mkdir (" products/$platform " )
34+ run (` tar -xzf products/$(tarball_name) -C products/$platform ` )
35+
36+ if isfile (" products/$platform /deps.tar.gz" )
37+ # Unzip the tarball of the dependencies
38+ run (` tar -xzf products/$platform /deps.tar.gz -C products/$platform ` )
39+
40+ # Copy the license of each dependency
41+ for folder in readdir (" products/$platform /deps/licenses" )
42+ cp (" products/$platform /deps/licenses/$folder " , " products/$platform /share/licenses/$folder " )
43+ end
44+ rm (" products/$platform /deps/licenses" , recursive= true )
45+
46+ # Copy the shared library of each dependency
47+ for file in readdir (" products/$platform /deps" )
48+ cp (" products/$platform /deps/$file " , " products/$platform /$libdir /$file " )
49+ end
50+
51+ # Remove the folder used to unzip the tarball of the dependencies
52+ rm (" products/$platform /deps" , recursive= true )
53+ rm (" products/$platform /deps.tar.gz" , recursive= true )
54+
55+ # Create the archives *_binaries
56+ isfile (" $(package) _binaries.$version2 .$platform .tar.gz" ) && rm (" $(package) _binaries.$version2 .$platform .tar.gz" )
57+ isfile (" $(package) _binaries.$version2 .$platform .zip" ) && rm (" $(package) _binaries.$version2 .$platform .zip" )
58+ cd (" products/$platform " )
59+
60+ # Create a folder with the version number of the package
61+ mkdir (" $(package) _binaries.$version2 " )
62+ for folder in (" include" , " share" , " modules" , " lib" , " bin" )
63+ cp (folder, " $(package) _binaries.$version2 /$folder " )
64+ end
65+
66+ cd (" $(package) _binaries.$version2 " )
67+ if ext == " dll"
68+ run (` zip -r --symlinks ../../../$(package) _binaries.$version2 .$platform .zip include share modules lib bin` )
69+ else
70+ run (` tar -czf ../../../$(package) _binaries.$version2 .$platform .tar.gz include share modules lib bin` )
71+ end
72+ cd (" ../../.." )
73+
74+ # Remove the folder used to unzip the tarball generated by BinaryBuilder.jl
75+ rm (" products/$platform " , recursive= true )
76+ else
77+ @warn (" The tarball deps.tar.gz is missing in $(tarball_name) !" )
78+ end
79+ else
80+ @warn (" The tarball for the platform $platform was not generated!" )
81+ end
82+ end
0 commit comments