mirror of
https://github.com/serokell/xrefcheck.git
synced 2024-08-16 09:00:45 +03:00
Merge pull request #16 from serokell/balsoft/static-building
[INT-111] Allow to build crossref-verify statically
This commit is contained in:
commit
38bd3b7920
@ -4,8 +4,16 @@
|
||||
|
||||
steps:
|
||||
- command: nix-build crossref-verifier.nix
|
||||
label: build everything
|
||||
label: Library and tests
|
||||
- command: nix-build
|
||||
label: Executable
|
||||
artifact_paths:
|
||||
- "result/bin/crossref-verify"
|
||||
- command: nix run -f. -c crossref-verify
|
||||
label: crossref-verify itself (import as if done externally)
|
||||
label: Crossref-verify itself
|
||||
- command: nix run -f $(nix eval -f nix/sources.nix --raw nixpkgs) reuse -c reuse lint
|
||||
label: reuse lint
|
||||
label: REUSE lint
|
||||
- command:
|
||||
- GITHUB_TOKEN=$(cat ~/niv-bot-token) NIX_PATH=nixpkgs=$(nix eval --raw '(import ./nix/sources.nix).nixpkgs') nix-shell -p curl git gitAndTools.hub --run "curl https://raw.githubusercontent.com/serokell/scratch/release-binary/scripts/release-binary.sh | bash"
|
||||
label: Create a pre-release
|
||||
branches: master
|
||||
|
@ -2,10 +2,14 @@
|
||||
#
|
||||
# SPDX-License-Identifier: MPL-2.0
|
||||
|
||||
{ static ? true }:
|
||||
let
|
||||
sources = import ./nix/sources.nix;
|
||||
nixpkgs = import sources.nixpkgs (import sources."haskell.nix");
|
||||
hn = nixpkgs.haskell-nix;
|
||||
hn = if static then
|
||||
nixpkgs.pkgsCross.musl64.haskell-nix
|
||||
else
|
||||
nixpkgs.haskell-nix;
|
||||
project = hn.stackProject {
|
||||
src = hn.haskellLib.cleanGit { src = ./.; };
|
||||
modules = [{
|
||||
@ -14,6 +18,21 @@ let
|
||||
postHaddock = ''
|
||||
[[ -z "$(ls -A dist/doc/html)" ]] && exit 1 || echo "haddock successfully generated documentation"'';
|
||||
package.ghcOptions = "-Werror";
|
||||
components.exes.crossref-verify.configureFlags =
|
||||
with nixpkgs.pkgsStatic;
|
||||
lib.optionals static [
|
||||
"--disable-executable-dynamic"
|
||||
"--disable-shared"
|
||||
"--ghc-option=-optl=-pthread"
|
||||
"--ghc-option=-optl=-static"
|
||||
"--ghc-option=-optl=-lc"
|
||||
"--ghc-option=-optl=-lz"
|
||||
"--ghc-option=-optl=-lgmp"
|
||||
"--ghc-option=-optl=-lffi"
|
||||
"--ghc-option=-optl=-L${gmp6}/lib"
|
||||
"--ghc-option=-optl=-L${zlib.static}/lib"
|
||||
"--ghc-option=-optl=-L${libffi}/lib"
|
||||
];
|
||||
};
|
||||
}];
|
||||
cache = with sources; [{
|
||||
|
@ -2,4 +2,4 @@
|
||||
#
|
||||
# SPDX-License-Identifier: MPL-2.0
|
||||
|
||||
(import ./crossref-verifier.nix).components.exes.crossref-verify
|
||||
(import ./crossref-verifier.nix {}).components.exes.crossref-verify
|
||||
|
20
release/default.nix
Normal file
20
release/default.nix
Normal file
@ -0,0 +1,20 @@
|
||||
# SPDX-FileCopyrightText: 2019 Serokell <https://serokell.io>
|
||||
#
|
||||
# SPDX-License-Identifier: MPL-2.0
|
||||
|
||||
{ pkgs ? import (import ../nix/sources.nix).nixpkgs { } }:
|
||||
let
|
||||
executable = (import ../crossref-verifier.nix {
|
||||
static = true;
|
||||
}).components.exes.crossref-verify;
|
||||
joinByBasename = name: paths:
|
||||
pkgs.runCommandNoCC name { } (''
|
||||
mkdir $out
|
||||
'' + pkgs.lib.concatMapStrings (path: ''
|
||||
ln -s ${path} $out/${builtins.baseNameOf path}
|
||||
'') paths);
|
||||
in joinByBasename "crossref-verifier-release" [
|
||||
"${executable}/bin"
|
||||
../LICENSES
|
||||
../README.md
|
||||
]
|
Loading…
Reference in New Issue
Block a user