2024-11-15 15:12:05 -06:00
|
|
|
# To update to the newest version of SWORD do the following:
|
|
|
|
|
# * Scroll down to the line where the "rev" is listed
|
|
|
|
|
# * Update that value to match the latest revision of SWORD's SVN trunk
|
|
|
|
|
# * Comment out the hash line below that
|
|
|
|
|
# * Run a `nix build` on the current target
|
|
|
|
|
# * When you receive an error about the hash mismatch, copy the correct value
|
|
|
|
|
# and paste it into the hash as the new value, then uncomment the hash
|
|
|
|
|
# * Run the build again. It won't need to re-fetch the sources, it will only
|
|
|
|
|
# execute the build
|
2024-10-25 15:59:54 -05:00
|
|
|
{
|
2024-11-15 15:12:05 -06:00
|
|
|
description = "Subversion SWORD builds.";
|
2024-10-25 15:59:54 -05:00
|
|
|
inputs = {
|
|
|
|
|
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
|
|
|
|
|
flake-parts.url = "github:hercules-ci/flake-parts";
|
|
|
|
|
flake-root.url = "github:srid/flake-root";
|
|
|
|
|
hooks.url = "github:cachix/git-hooks.nix";
|
2025-08-06 20:14:45 -05:00
|
|
|
aarch_fix.url = "github:greg-hellings/nixpkgs/ucrt/zlib";
|
2024-10-25 15:59:54 -05:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
outputs =
|
|
|
|
|
{ flake-parts, ... }@inputs:
|
|
|
|
|
flake-parts.lib.mkFlake { inherit inputs; } {
|
|
|
|
|
imports = [ inputs.flake-root.flakeModule ];
|
|
|
|
|
flake = {
|
|
|
|
|
# Universal things
|
|
|
|
|
overlays.default = _final: _prev: { };
|
|
|
|
|
};
|
|
|
|
|
systems = [
|
|
|
|
|
"x86_64-linux"
|
|
|
|
|
"aarch64-linux"
|
|
|
|
|
"aarch64-darwin"
|
|
|
|
|
];
|
|
|
|
|
perSystem =
|
|
|
|
|
{ pkgs, self', ... }@inputs':
|
2025-08-06 20:14:45 -05:00
|
|
|
let
|
|
|
|
|
arm = (import inputs.aarch_fix { inherit (inputs') system; });
|
|
|
|
|
in
|
2024-10-25 15:59:54 -05:00
|
|
|
{
|
|
|
|
|
_module.args.pkgs = import inputs.nixpkgs {
|
|
|
|
|
inherit (inputs') system;
|
|
|
|
|
};
|
2025-04-01 14:00:33 -05:00
|
|
|
|
2024-10-25 15:59:54 -05:00
|
|
|
devShells.default = pkgs.mkShell {
|
|
|
|
|
# These will just be available
|
|
|
|
|
packages = with pkgs; [ pre-commit ];
|
|
|
|
|
|
|
|
|
|
buildInputs = self'.checks.pre-commit.enabledPackages;
|
|
|
|
|
|
|
|
|
|
inherit (self'.checks.pre-commit) shellHook;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
checks = {
|
|
|
|
|
pre-commit = inputs.hooks.lib.${inputs'.system}.run {
|
|
|
|
|
src = ./.;
|
|
|
|
|
hooks = {
|
|
|
|
|
check-added-large-files.enable = true;
|
|
|
|
|
check-case-conflicts.enable = true;
|
|
|
|
|
check-merge-conflicts.enable = true;
|
|
|
|
|
check-symlinks.enable = true;
|
|
|
|
|
deadnix.enable = true;
|
|
|
|
|
end-of-file-fixer.enable = true;
|
|
|
|
|
fix-byte-order-marker.enable = true;
|
|
|
|
|
mixed-line-endings.enable = true;
|
|
|
|
|
nixfmt-rfc-style.enable = true;
|
|
|
|
|
trim-trailing-whitespace.enable = true;
|
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
# This is not special, this is just flakes
|
|
|
|
|
packages =
|
|
|
|
|
let
|
2025-02-06 14:38:55 -06:00
|
|
|
tar =
|
|
|
|
|
win:
|
|
|
|
|
let
|
|
|
|
|
svnSword = (
|
|
|
|
|
win.sword.overrideAttrs {
|
|
|
|
|
src = pkgs.fetchsvn {
|
|
|
|
|
url = "https://svn.crosswire.org/svn/sword/trunk";
|
2025-08-06 20:14:45 -05:00
|
|
|
rev = "3912";
|
|
|
|
|
hash = "sha256-2VgoBdoJtbND++aQ2kDomr6LjYcUyyDwbgWNp5k07Uk=";
|
2025-02-06 14:38:55 -06:00
|
|
|
};
|
2025-06-19 23:10:41 -05:00
|
|
|
patches = [ ];
|
2025-02-06 14:38:55 -06:00
|
|
|
}
|
|
|
|
|
);
|
|
|
|
|
in
|
2025-02-06 16:59:29 -06:00
|
|
|
pkgs.writeShellApplication {
|
|
|
|
|
name = "package-sword";
|
|
|
|
|
runtimeInputs = with pkgs; [
|
2025-04-01 14:00:33 -05:00
|
|
|
coreutils
|
2025-02-06 16:59:29 -06:00
|
|
|
gnutar
|
|
|
|
|
xz
|
|
|
|
|
];
|
|
|
|
|
text = ''
|
2025-04-01 14:00:33 -05:00
|
|
|
set -x
|
2025-02-06 16:59:29 -06:00
|
|
|
out=$(pwd)
|
|
|
|
|
pushd ${svnSword}
|
2025-04-01 14:00:33 -05:00
|
|
|
tar --mtime="$(date +'%Y-%m-%d')" -cvhaf "$out/sword.tar.xz" ./* --transform "s+^\\./+sword/+"
|
2025-02-06 16:59:29 -06:00
|
|
|
'';
|
|
|
|
|
};
|
2025-02-06 14:38:55 -06:00
|
|
|
in
|
|
|
|
|
with pkgs.pkgsCross;
|
|
|
|
|
{
|
|
|
|
|
default = tar mingwW64;
|
|
|
|
|
x86 = tar mingwW64;
|
|
|
|
|
ucrt = tar ucrt64;
|
2025-08-06 20:14:45 -05:00
|
|
|
ucrtAarch = tar arm.pkgsCross.ucrtAarch64;
|
2024-10-25 15:59:54 -05:00
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
}
|