File tree Expand file tree Collapse file tree 5 files changed +72
-0
lines changed
Expand file tree Collapse file tree 5 files changed +72
-0
lines changed Original file line number Diff line number Diff line change @@ -55,3 +55,5 @@ dkms.conf
5555bin /
5656
5757vendor /
58+
59+ result
Original file line number Diff line number Diff line change @@ -64,6 +64,10 @@ containerized: bin
6464static :
6565 $(MAKE ) git-vars bin/conmon PKG_CONFIG=' $(PKG_CONFIG) --static' CFLAGS=' -static' LDFLAGS=' $(LDFLAGS) -s -w -static' LIBS=' $(LIBS)'
6666
67+ nixpkgs :
68+ @nix run -f channel:nixpkgs-unstable nix-prefetch-git -c nix-prefetch-git \
69+ --no-deepClone https://github.com/nixos/nixpkgs > nix/nixpkgs.json
70+
6771bin/conmon : $(OBJS ) | bin
6872 $(CC ) $(LDFLAGS ) $(CFLAGS ) -o $@ $^ $(LIBS )
6973
Original file line number Diff line number Diff line change 1+ { system ? builtins . currentSystem } :
2+ let
3+ pkgs = ( import ./nixpkgs.nix {
4+ overlays = [ ( final : prev : {
5+ pcre = prev . pcre . overrideAttrs ( x : {
6+ configureFlags = x . configureFlags ++ [ "--enable-static" ] ;
7+ } ) ;
8+ } ) ] ;
9+ config = {
10+ packageOverrides = pkg : {
11+ glib = pkg . glib . overrideAttrs ( x : {
12+ outputs = [ "bin" "out" "dev" ] ;
13+ mesonFlags = [
14+ "-Ddefault_library=static"
15+ "-Ddevbindir=${ placeholder ''dev'' } /bin"
16+ "-Dgtk_doc=false"
17+ "-Dnls=disabled"
18+ ] ;
19+ } ) ;
20+ systemd = pkg . systemd . overrideAttrs ( x : {
21+ mesonFlags = x . mesonFlags ++ [ "-Dstatic-libsystemd=true" ] ;
22+ postFixup = ''
23+ ${ x . postFixup }
24+ sed -ri "s;$out/(.*);$nukedRef/\1;g" $lib/lib/libsystemd.a
25+ '' ;
26+ } ) ;
27+ } ;
28+ } ;
29+ } ) ;
30+
31+ self = with pkgs ; {
32+ conmon-static = ( conmon . overrideAttrs ( x : {
33+ name = "conmon-static" ;
34+ src = ./.. ;
35+ doCheck = false ;
36+ buildInputs = [
37+ glib
38+ glibc
39+ glibc . static
40+ pcre
41+ systemd
42+ ] ;
43+ prePatch = ''
44+ export LDFLAGS='-static-libgcc -static'
45+ '' ;
46+ } ) ) ;
47+ } ;
48+ in self
Original file line number Diff line number Diff line change 1+ {
2+ "url" : " https://github.com/nixos/nixpkgs" ,
3+ "rev" : " 1b5925f2189dc9b4ebf7168252bf89a94b7405ba" ,
4+ "date" : " 2020-05-27T15:03:28+02:00" ,
5+ "path" : " /nix/store/qdsrj7hw9wzzng9l2kfbsyi9ynprrn6p-nixpkgs" ,
6+ "sha256" : " 0q9plknr294k4bjfqvgvp5vglfby5yn64k6ml0gqwi0dwf0qi6fv" ,
7+ "fetchSubmodules" : false ,
8+ "deepClone" : false ,
9+ "leaveDotGit" : false
10+ }
Original file line number Diff line number Diff line change 1+ let
2+ json = builtins . fromJSON ( builtins . readFile ./nixpkgs.json ) ;
3+ nixpkgs = import ( builtins . fetchTarball {
4+ name = "nixos-unstable" ;
5+ url = "${ json . url } /archive/${ json . rev } .tar.gz" ;
6+ inherit ( json ) sha256 ;
7+ } ) ;
8+ in nixpkgs
You can’t perform that action at this time.
0 commit comments