mirror of
https://github.com/AltraMayor/f3.git
synced 2026-09-30 12:15:42 +02:00
This commit restructures the project to follow a more standard C project layout and improve maintainability: - Moved all C source and header files to the `src/` directory. - Moved the manual page (`f3read.1`) to the `man/` directory. - Moved helper shell scripts to the `scripts/` directory. - Updated the Makefile to support out-of-source builds, placing all compiled objects and binaries into a new `build/` directory. - Updated `.github/workflows/test.yml` to ensure CI correctly builds and tests from the new directory structure. - Updated `README.rst`, `doc/usage.rst`, and `flake.nix` to reflect the new file locations and build instructions. - Modified `.gitignore` to exclude the `build/` directory while removing specific individual binary exclusions. This commit closes #246
56 lines
1.5 KiB
Nix
56 lines
1.5 KiB
Nix
{
|
|
description = "F3 - Fight flash fraud";
|
|
|
|
inputs = {
|
|
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
|
|
};
|
|
|
|
outputs = { self, nixpkgs }: {
|
|
packages = nixpkgs.lib.genAttrs [ "aarch64-linux" "x86_64-linux" "aarch64-darwin" ] (system:
|
|
let
|
|
pkgs = import nixpkgs { inherit system; };
|
|
in
|
|
{
|
|
f3 = pkgs.stdenv.mkDerivation {
|
|
pname = "f3";
|
|
version = builtins.head (builtins.match ''.*#define[[:space:]]+F3_STR_VERSION[[:space:]]+"([0-9.]+)".*'' (builtins.readFile (self + "/src/version.h")));
|
|
src = ./.;
|
|
nativeBuildInputs = [ pkgs.clang ];
|
|
buildInputs = pkgs.lib.optionals pkgs.stdenv.hostPlatform.isLinux [
|
|
pkgs.systemd
|
|
pkgs.parted
|
|
]
|
|
++ pkgs.lib.optionals pkgs.stdenv.hostPlatform.isDarwin [ pkgs.argp-standalone ];
|
|
|
|
installPhase = ''
|
|
runHook preInstall
|
|
mkdir -p $out/bin
|
|
make install PREFIX=$out
|
|
make install-extra PREFIX=$out
|
|
runHook postInstall
|
|
'';
|
|
|
|
meta = with pkgs.lib; {
|
|
description = "F3 - Fight flash fraud";
|
|
license = licenses.gpl3;
|
|
maintainers = [ maintainers.llamato ];
|
|
platforms = platforms.unix;
|
|
};
|
|
};
|
|
|
|
devShells.${system}.default = pkgs.mkShell {
|
|
buildInputs = with pkgs; [
|
|
cmake
|
|
gcc
|
|
gdb
|
|
];
|
|
};
|
|
});
|
|
|
|
defaultPackage = {
|
|
x86_64-linux = self.packages.x86_64-linux.f3;
|
|
aarch64-linux = self.packages.aarch64-linux.f3;
|
|
aarch64-darwin = self.packages.aarch64-darwin.f3;
|
|
};
|
|
};
|
|
} |