File tree Expand file tree Collapse file tree 2 files changed +44
-2
lines changed Expand file tree Collapse file tree 2 files changed +44
-2
lines changed Original file line number Diff line number Diff line change 22 description = "A tool for modifying ELF executables and libraries" ;
33
44 inputs . nixpkgs . url = "nixpkgs/nixpkgs-unstable" ;
5+ inputs . nixpkgs-mingw . url = "github:Mic92/nixpkgs/mingw" ;
56
6- outputs = { self , nixpkgs } :
7+ outputs = { self , nixpkgs , nixpkgs-mingw } :
78
89 let
910 supportedSystems = [ "x86_64-linux" "i686-linux" "aarch64-linux" ] ;
1617 inherit version ;
1718 src = self ;
1819 } ;
20+
21+ # https://github.com/NixOS/nixpkgs/pull/199883
22+ pkgsCrossForMingw = system : ( import nixpkgs-mingw {
23+ inherit system ;
24+ overlays = [
25+ ( final : prev : {
26+ threadsCross = {
27+ model = "win32" ;
28+ package = null ;
29+ } ;
30+ } )
31+ ] ;
32+ } ) . pkgsCross ;
33+
1934 in
2035
2136 {
6378 stdenv = nixpkgs . legacyPackages . ${ system } . llvmPackages_latest . libcxxStdenv ;
6479 } ) ;
6580
81+ # To get mingw compiler from hydra cache
82+ inherit ( self . packages . x86_64-linux ) patchelf-win32 patchelf-win64 ;
83+
6684 release = pkgs . releaseTools . aggregate
6785 { name = "patchelf-${ self . hydraJobs . tarball . version } " ;
6886 constituents =
95113 packages = forAllSystems ( system : {
96114 patchelf = patchelfFor nixpkgs . legacyPackages . ${ system } ;
97115 default = self . packages . ${ system } . patchelf ;
116+
117+ patchelf-win32 = ( patchelfFor ( pkgsCrossForMingw system ) . mingw32 ) . overrideAttrs ( old : {
118+ NIX_CFLAGS_COMPILE = "-static" ;
119+ } ) ;
120+ patchelf-win64 = ( patchelfFor ( pkgsCrossForMingw system ) . mingwW64 ) . overrideAttrs ( old : {
121+ NIX_CFLAGS_COMPILE = "-static" ;
122+ } ) ;
98123 } // nixpkgs . lib . optionalAttrs ( system != "i686-linux" ) {
99124 patchelf-musl = patchelfFor nixpkgs . legacyPackages . ${ system } . pkgsMusl ;
100125 } ) ;
You can’t perform that action at this time.
0 commit comments