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 2
2
description = "A tool for modifying ELF executables and libraries" ;
3
3
4
4
inputs . nixpkgs . url = "nixpkgs/nixpkgs-unstable" ;
5
+ inputs . nixpkgs-mingw . url = "github:Mic92/nixpkgs/mingw" ;
5
6
6
- outputs = { self , nixpkgs } :
7
+ outputs = { self , nixpkgs , nixpkgs-mingw } :
7
8
8
9
let
9
10
supportedSystems = [ "x86_64-linux" "i686-linux" "aarch64-linux" ] ;
16
17
inherit version ;
17
18
src = self ;
18
19
} ;
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
+
19
34
in
20
35
21
36
{
63
78
stdenv = nixpkgs . legacyPackages . ${ system } . llvmPackages_latest . libcxxStdenv ;
64
79
} ) ;
65
80
81
+ # To get mingw compiler from hydra cache
82
+ inherit ( self . packages . x86_64-linux ) patchelf-win32 patchelf-win64 ;
83
+
66
84
release = pkgs . releaseTools . aggregate
67
85
{ name = "patchelf-${ self . hydraJobs . tarball . version } " ;
68
86
constituents =
95
113
packages = forAllSystems ( system : {
96
114
patchelf = patchelfFor nixpkgs . legacyPackages . ${ system } ;
97
115
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
+ } ) ;
98
123
} // nixpkgs . lib . optionalAttrs ( system != "i686-linux" ) {
99
124
patchelf-musl = patchelfFor nixpkgs . legacyPackages . ${ system } . pkgsMusl ;
100
125
} ) ;
You can’t perform that action at this time.
0 commit comments