Pinetab-v: rope in config
This commit is contained in:
36
flake.lock
generated
36
flake.lock
generated
@@ -122,6 +122,22 @@
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixos-hardware": {
|
||||
"locked": {
|
||||
"lastModified": 1720158314,
|
||||
"narHash": "sha256-QNEOk6xmw3ct7P70wKzkGoqeb5gyJWEFdw7AZIul9V4=",
|
||||
"owner": "CyborgPotato",
|
||||
"repo": "nixos-hardware",
|
||||
"rev": "c905e5bf25f9eab4cd3e014d3157fa3a62c3a5b6",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "CyborgPotato",
|
||||
"ref": "master",
|
||||
"repo": "nixos-hardware",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1718530797,
|
||||
@@ -155,6 +171,22 @@
|
||||
}
|
||||
},
|
||||
"nixpkgs-stable_2": {
|
||||
"locked": {
|
||||
"lastModified": 1720553833,
|
||||
"narHash": "sha256-IXMiHQMtdShDXcBW95ctA+m5Oq2kLxnBt7WlMxvDQXA=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "249fbde2a178a2ea2638b65b9ecebd531b338cf9",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "NixOS",
|
||||
"ref": "nixos-24.05",
|
||||
"repo": "nixpkgs",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixpkgs-stable_3": {
|
||||
"locked": {
|
||||
"lastModified": 1718478900,
|
||||
"narHash": "sha256-v43N1gZLcGkhg3PdcrKUNIZ1L0FBzB2JqhIYEyKAHEs=",
|
||||
@@ -191,14 +223,16 @@
|
||||
"home-manager": "home-manager",
|
||||
"me-emacs": "me-emacs",
|
||||
"nix-darwin": "nix-darwin",
|
||||
"nixos-hardware": "nixos-hardware",
|
||||
"nixpkgs": "nixpkgs",
|
||||
"nixpkgs-stable": "nixpkgs-stable_2",
|
||||
"sops-nix": "sops-nix"
|
||||
}
|
||||
},
|
||||
"sops-nix": {
|
||||
"inputs": {
|
||||
"nixpkgs": "nixpkgs_2",
|
||||
"nixpkgs-stable": "nixpkgs-stable_2"
|
||||
"nixpkgs-stable": "nixpkgs-stable_3"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1718506969,
|
||||
|
||||
24
flake.nix
24
flake.nix
@@ -1,6 +1,8 @@
|
||||
{
|
||||
inputs = {
|
||||
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
||||
nixpkgs-stable.url = "github:NixOS/nixpkgs/nixos-24.05";
|
||||
nixos-hardware.url = "github:CyborgPotato/nixos-hardware/master";
|
||||
sops-nix.url = "github:Mic92/sops-nix";
|
||||
me-emacs.url = "git+https://git.syzygial.cc/Syzygial/EmacsConfig.git";
|
||||
me-emacs.inputs.nixpkgs.follows = "nixpkgs";
|
||||
@@ -10,7 +12,7 @@
|
||||
home-manager.inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
|
||||
outputs = { self, nixpkgs, sops-nix, me-emacs, nix-darwin, home-manager }@attrs: let
|
||||
outputs = { self, nixpkgs, nixpkgs-stable, nixos-hardware, sops-nix, me-emacs, nix-darwin, home-manager }@attrs: let
|
||||
hydraGitea = import ./overlays/hydra.nix;
|
||||
nvidiaContainer = import ./overlays/nvidiacontainer.nix nixpkgs;
|
||||
me-emacs-overlay = me-emacs.overlays.default;
|
||||
@@ -48,6 +50,22 @@
|
||||
sops-nix.nixosModules.sops
|
||||
];
|
||||
};
|
||||
ptv = let
|
||||
patch-8gb = {
|
||||
hardware.deviceTree.overlays = [{
|
||||
name = "8GB-patch";
|
||||
dtsFile = "${nixos-hardware}/pine64/pinetab-v/star64-8GB.dts";
|
||||
}];
|
||||
};
|
||||
in nixpkgs-stable.lib.nixosSystem {
|
||||
specialArgs = {
|
||||
inputs = attrs;
|
||||
};
|
||||
modules = [
|
||||
./machines/ptv/configuration.nix
|
||||
patch-8gb
|
||||
];
|
||||
};
|
||||
};
|
||||
darwinConfigurations."UniverseAir" = nix-darwin.lib.darwinSystem {
|
||||
system = "aarch64-darwin";
|
||||
@@ -77,5 +95,9 @@
|
||||
inputs = attrs;
|
||||
};
|
||||
};
|
||||
|
||||
hydraJobs = {
|
||||
PinetabV = self.nixosConfigurations.ptv.config.system.build.toplevel;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
42
machines/ptv/ccache.nix
Normal file
42
machines/ptv/ccache.nix
Normal file
@@ -0,0 +1,42 @@
|
||||
{ config, pkgs, lib, inputs, ... }: {
|
||||
programs.ccache.enable = true;
|
||||
programs.ccache.cacheDir = "/opt/ccache";
|
||||
nix.settings.extra-sandbox-paths = [ "/opt/ccache" ];
|
||||
nixpkgs.overlays = [
|
||||
(self: super: {
|
||||
ccacheWrapper = super.ccacheWrapper.override {
|
||||
# TODO: Sloppiness random_seed apart of wrapper
|
||||
extraConfig = ''
|
||||
export CCACHE_COMPRESS=1
|
||||
export CCACHE_DIR="${config.programs.ccache.cacheDir}"
|
||||
export CCACHE_UMASK=007
|
||||
if [ ! -d "$CCACHE_DIR" ]; then
|
||||
echo "====="
|
||||
echo "Directory '$CCACHE_DIR' does not exist"
|
||||
echo "Please create it with:"
|
||||
echo " sudo mkdir -m0770 '$CCACHE_DIR'"
|
||||
echo " sudo chown root:nixbld '$CCACHE_DIR'"
|
||||
echo "====="
|
||||
exit 1
|
||||
fi
|
||||
if [ ! -w "$CCACHE_DIR" ]; then
|
||||
echo "====="
|
||||
echo "Directory '$CCACHE_DIR' is not accessible for user $(whoami)"
|
||||
echo "Please verify its access permissions"
|
||||
echo "====="
|
||||
exit 1
|
||||
fi
|
||||
'';
|
||||
};
|
||||
linux-ptv-ccache = pkgs.callPackage "${inputs.nixos-hardware}/pine64/pinetab-v/linux-5.15.nix" {
|
||||
argsOverride = {
|
||||
stdenv = self.ccacheStdenv;
|
||||
};
|
||||
};
|
||||
})
|
||||
];
|
||||
|
||||
programs.ccache.packageNames = [ "ffmpeg" "firefox-unwrapped" "tmux" ];
|
||||
|
||||
boot.kernelPackages = pkgs.linuxPackagesFor pkgs.linux-ptv-ccache;
|
||||
}
|
||||
91
machines/ptv/configuration.nix
Normal file
91
machines/ptv/configuration.nix
Normal file
@@ -0,0 +1,91 @@
|
||||
{ lib, pkgs, config, inputs, ... }: let
|
||||
inherit (pkgs.checkpointBuildTools) prepareCheckpointBuild mkCheckpointBuild;
|
||||
linux-cached = prepareCheckpointBuild pkgs.linux-ptv;
|
||||
linux-changed = pkgs.linux-ptv;
|
||||
linux-ptv = pkgs.checkpointBuildTools.mkCheckpointBuild linux-changed linux-cached;
|
||||
in {
|
||||
# boot.kernelPackages = pkgs.linuxPackagesFor linux-ptv;
|
||||
boot.kernelParams = lib.mkDefault [ "console=tty0" "console=ttyS0" ];
|
||||
|
||||
systemd.services."getty@tty0".enable = lib.mkDefault true;
|
||||
systemd.services."getty@tty0".wantedBy = lib.mkDefault [ "getty.target" ];
|
||||
|
||||
system.stateVersion = "24.05";
|
||||
nixpkgs.hostPlatform = "riscv64-linux";
|
||||
networking.hostName = "ptv";
|
||||
nix.registry.nixpkgs.flake = inputs.nixpkgs;
|
||||
nix.settings.experimental-features = [ "nix-command" "flakes" ];
|
||||
|
||||
nixpkgs.overlays = [
|
||||
(final: prev: {
|
||||
# https://github.com/starfive-tech/soft_3rdpart/tree/JH7110_VisionFive2_devel
|
||||
# Source of different firmware/3rd party sw and fw
|
||||
img-rogue-firmware = pkgs.stdenv.mkDerivation {
|
||||
pname = "img-gpu-powervr";
|
||||
version = "36-working-on-it";
|
||||
|
||||
src = ./rgx-img-gpu-firmware.tar.gz;
|
||||
dontBuild = true;
|
||||
|
||||
passthru = {
|
||||
compressFirmware = false;
|
||||
};
|
||||
|
||||
installPhase = ''
|
||||
runHook preInstall
|
||||
|
||||
mkdir -p $out/lib/firmware
|
||||
cp * $out/lib/firmware
|
||||
|
||||
runHook postInstall
|
||||
'';
|
||||
};
|
||||
})
|
||||
(import ./pkgs)
|
||||
];
|
||||
|
||||
imports = [
|
||||
"${inputs.nixos-hardware}/pine64/pinetab-v/sd-image.nix"
|
||||
# ./ccache.nix
|
||||
./native-bootstrap.nix
|
||||
];
|
||||
|
||||
users.users = {
|
||||
pine64 = {
|
||||
isNormalUser = true;
|
||||
extraGroups = [ "wheel" ];
|
||||
initialHashedPassword = "$y$j9T$cuXgVIPt3n1.v7GcoXiql1$4EBlHM7sYO.lL.DTDwQzTBqSYsD01WIDZQXleCeozl8";
|
||||
};
|
||||
root = {
|
||||
initialHashedPassword = "$y$j9T$cuXgVIPt3n1.v7GcoXiql1$4EBlHM7sYO.lL.DTDwQzTBqSYsD01WIDZQXleCeozl8";
|
||||
};
|
||||
};
|
||||
|
||||
networking.wireless.enable = true;
|
||||
networking.wireless.userControlled.enable = true;
|
||||
|
||||
#programs.hyprland = {
|
||||
# Install the packages from nixpkgs
|
||||
# enable = true;
|
||||
# Whether to enable XWayland
|
||||
# xwayland.enable = true;
|
||||
#};
|
||||
|
||||
environment.systemPackages = with pkgs; [
|
||||
dropbear
|
||||
busybox
|
||||
tmux
|
||||
git
|
||||
|
||||
weston
|
||||
|
||||
# ffmpeg
|
||||
# firefox
|
||||
];
|
||||
|
||||
hardware.firmware = pkgs.lib.mkOrder 1000 [
|
||||
pkgs.img-rogue-firmware
|
||||
];
|
||||
|
||||
services.openssh.enable = true;
|
||||
}
|
||||
BIN
machines/ptv/img-gpu-powervr-bin-1.15.6052913.tar.gz
Normal file
BIN
machines/ptv/img-gpu-powervr-bin-1.15.6052913.tar.gz
Normal file
Binary file not shown.
BIN
machines/ptv/img-gpu-powervr-bin-1.17.6210866.tar.gz
Normal file
BIN
machines/ptv/img-gpu-powervr-bin-1.17.6210866.tar.gz
Normal file
Binary file not shown.
37
machines/ptv/native-bootstrap.nix
Normal file
37
machines/ptv/native-bootstrap.nix
Normal file
@@ -0,0 +1,37 @@
|
||||
{ config, pkgs, lib, ...}: let
|
||||
stdenvStages = curStage:
|
||||
[ curStage ]
|
||||
++
|
||||
(if curStage.hasCC
|
||||
then [curStage.cc] ++ (stdenvStages curStage.__bootPackages.stdenv)
|
||||
else []);
|
||||
in {
|
||||
system.includeBuildDependencies = true;
|
||||
system.extraDependencies = with pkgs;
|
||||
lib.optionals (stdenv.buildPlatform == stdenv.hostPlatform)
|
||||
((stdenvStages stdenv) ++ [
|
||||
stdenvNoCC
|
||||
clangStdenv
|
||||
clangStdenv.cc
|
||||
clang
|
||||
libllvm
|
||||
gcc
|
||||
rustc
|
||||
cargo
|
||||
coreutils
|
||||
curl
|
||||
wget
|
||||
python3
|
||||
# Other common build tools
|
||||
zip
|
||||
unzip
|
||||
cmake
|
||||
meson
|
||||
bison
|
||||
perl
|
||||
zlib
|
||||
busybox
|
||||
xz
|
||||
binutils
|
||||
]);
|
||||
}
|
||||
17
machines/ptv/pkgs-cross/argyllcms/default.nix
Normal file
17
machines/ptv/pkgs-cross/argyllcms/default.nix
Normal file
@@ -0,0 +1,17 @@
|
||||
final: prev: prev.argyllcms.overrideAttrs (old: {
|
||||
postInstall = (prev.lib.optional (prev.stdenv.hostPlatform != prev.stdenv.buildPlatform) ''
|
||||
cp imdi/imdi_make $out/bin
|
||||
cp gamut/GenRMGam $out/bin
|
||||
'');
|
||||
patches = (prev.lib.optionals (prev.stdenv.hostPlatform != prev.stdenv.buildPlatform) [
|
||||
./imdi_make.patch
|
||||
]);
|
||||
preBuild = (prev.lib.optional (prev.stdenv.hostPlatform != prev.stdenv.buildPlatform) ''
|
||||
cd imdi; imdi_make; cd ..
|
||||
cd gamut; GenRMGam; cd ..
|
||||
'');
|
||||
# Need to use build version of imdi_make && host version for output
|
||||
depsBuildBuild = (prev.lib.optionals (prev.stdenv.hostPlatform != prev.stdenv.buildPlatform) [
|
||||
prev.buildPackages.argyllcms
|
||||
]);
|
||||
})
|
||||
39
machines/ptv/pkgs-cross/argyllcms/imdi_make.patch
Normal file
39
machines/ptv/pkgs-cross/argyllcms/imdi_make.patch
Normal file
@@ -0,0 +1,39 @@
|
||||
diff --git a/gamut/Jamfile b/gamut/Jamfile
|
||||
index e97d0df..adc259f 100755
|
||||
--- a/gamut/Jamfile
|
||||
+++ b/gamut/Jamfile
|
||||
@@ -47,7 +47,7 @@ Main GenRMGam : GenRMGam.c ;
|
||||
# Generate referenec medium gamut the kernel files
|
||||
# (NoUpdate so that Cross Compile Win64 hack works)
|
||||
NNoUpdate RefMediumGamut.gam ;
|
||||
-GenFile RefMediumGamut.gam : GenRMGam ;
|
||||
+# GenFile RefMediumGamut.gam : GenRMGam ;
|
||||
|
||||
# Visual gamut
|
||||
Main GenVisGam : GenVisGam.c ;
|
||||
diff --git a/imdi/Jamfile b/imdi/Jamfile
|
||||
index 79b27fb..64c3348 100755
|
||||
--- a/imdi/Jamfile
|
||||
+++ b/imdi/Jamfile
|
||||
@@ -41,7 +41,7 @@ LINKLIBS = ../numlib/libnum ;
|
||||
|
||||
# GenFile source.c : program args ; make custom file
|
||||
# Generate all the kernel files
|
||||
-GenFileND imdi_k.h : imdi_make $(IMDI_MAKE_OPT) -d [ NormPaths $(DOT) ] ;
|
||||
+# GenFileND imdi_k.h : imdi_make $(IMDI_MAKE_OPT) -d [ NormPaths $(DOT) ] ;
|
||||
|
||||
# imdi library
|
||||
Library libimdi : imdi.c imdi_tab.c ;
|
||||
diff --git a/imdi/Makefile b/imdi/Makefile
|
||||
index 5523893..2048875 100755
|
||||
--- a/imdi/Makefile
|
||||
+++ b/imdi/Makefile
|
||||
@@ -48,7 +48,7 @@ imdi_gen$(SUFOBJ): imdi_gen.c imdi_utl.h imdi_arch.h imdi_gen.h
|
||||
|
||||
# Generate the kernel files
|
||||
imdi_k.h imdi_k.c : imdi_make$(SUFEXE)
|
||||
- .$(SLASH)imdi_make$(SUFEXE)
|
||||
+ imdi_make$(SUFEXE)
|
||||
|
||||
|
||||
# imdi runtime library
|
||||
4
machines/ptv/pkgs-cross/bundlerApp/default.nix
Normal file
4
machines/ptv/pkgs-cross/bundlerApp/default.nix
Normal file
@@ -0,0 +1,4 @@
|
||||
final: prev: prev.bundlerApp.override (old: {
|
||||
ruby = final.buildPackages.ruby;
|
||||
callPackage = final.newScope { ruby = final.buildPackages.ruby; };
|
||||
})
|
||||
3
machines/ptv/pkgs-cross/cryptsetup/default.nix
Normal file
3
machines/ptv/pkgs-cross/cryptsetup/default.nix
Normal file
@@ -0,0 +1,3 @@
|
||||
final: prev: prev.cryptsetup.overrideAttrs (old: {
|
||||
doCheck = false;
|
||||
})
|
||||
19
machines/ptv/pkgs-cross/default.nix
Normal file
19
machines/ptv/pkgs-cross/default.nix
Normal file
@@ -0,0 +1,19 @@
|
||||
(final: prev: {
|
||||
discount = (import ./discount) final prev;
|
||||
fwupd-efi = (import ./fwupd-efi) final prev;
|
||||
live555 = (import ./live555) final prev;
|
||||
protobuf = (import ./protobuf) final prev;
|
||||
bundlerApp = (import ./bundlerApp) final prev;
|
||||
vulkan-tools = (import ./vulkan-tools) final prev;
|
||||
libdrm = (import ./libdrm) final prev;
|
||||
valgrind = (import ./valgrind) final prev;
|
||||
valgrind-light = final.valgrind.override { gdb = null; };
|
||||
argyllcms = (import ./argyllcms) final prev;
|
||||
gn = (import ./gn) final prev;
|
||||
openfortivpn = (import ./openfortivpn) final prev;
|
||||
vpnc = (import ./vpnc) final prev;
|
||||
# perl538Packages.Testutf8 = (import ./perlTestutf8) final prev;
|
||||
diffutils = (import ./diffutils) final prev;
|
||||
gnugrep = (import ./gnugrep) final prev;
|
||||
cryptsetup = (import ./cryptsetup) final prev;
|
||||
})
|
||||
4
machines/ptv/pkgs-cross/diffutils/default.nix
Normal file
4
machines/ptv/pkgs-cross/diffutils/default.nix
Normal file
@@ -0,0 +1,4 @@
|
||||
|
||||
final: prev: prev.diffutils.overrideAttrs (old: {
|
||||
doCheck = false; #prev.stdenv.hostPlatform != "riscv64-linux";
|
||||
})
|
||||
23
machines/ptv/pkgs-cross/discount/config-sed.c
Normal file
23
machines/ptv/pkgs-cross/discount/config-sed.c
Normal file
@@ -0,0 +1,23 @@
|
||||
#include <stdio.h>
|
||||
|
||||
int
|
||||
main(argc, argv)
|
||||
int argc;
|
||||
char **argv;
|
||||
{
|
||||
char *p;
|
||||
|
||||
if (argc != 3)
|
||||
return 1;
|
||||
|
||||
printf("s;@%s@;", argv[1]);
|
||||
|
||||
for (p=argv[2]; *p; ++p) {
|
||||
if ( *p == ';' )
|
||||
putchar('\\');
|
||||
putchar(*p);
|
||||
}
|
||||
|
||||
puts(";g");
|
||||
return 0;
|
||||
}
|
||||
67
machines/ptv/pkgs-cross/discount/config-sed.patch
Normal file
67
machines/ptv/pkgs-cross/discount/config-sed.patch
Normal file
@@ -0,0 +1,67 @@
|
||||
diff --git a/configure.inc b/configure.inc
|
||||
index fd0c9ba..98066d5 100755
|
||||
--- a/configure.inc
|
||||
+++ b/configure.inc
|
||||
@@ -1733,52 +1733,6 @@ AC_FAIL() {
|
||||
$__fail 1
|
||||
}
|
||||
|
||||
-#
|
||||
-# __ac_config_sed; a C program to do escaping for AC_SUB
|
||||
-__ac_config_sed() {
|
||||
-
|
||||
-
|
||||
- test -x config.sed && return
|
||||
-
|
||||
- echo "generating config.sed"
|
||||
-
|
||||
- AC_PROG_CC
|
||||
-
|
||||
-cat > ngc$$.c << \EOF
|
||||
-#include <stdio.h>
|
||||
-
|
||||
-int
|
||||
-main(argc, argv)
|
||||
-int argc;
|
||||
-char **argv;
|
||||
-{
|
||||
- char *p;
|
||||
-
|
||||
- if (argc != 3)
|
||||
- return 1;
|
||||
-
|
||||
- printf("s;@%s@;", argv[1]);
|
||||
-
|
||||
- for (p=argv[2]; *p; ++p) {
|
||||
- if ( *p == ';' )
|
||||
- putchar('\\');
|
||||
- putchar(*p);
|
||||
- }
|
||||
-
|
||||
- puts(";g");
|
||||
- return 0;
|
||||
-}
|
||||
-EOF
|
||||
-
|
||||
- if $AC_CC -o config.sed ngc$$.c; then
|
||||
- rm -f ngc$$.c
|
||||
- __config_files="$__config_files config.sed"
|
||||
- else
|
||||
- rm -f ngc$$.c
|
||||
- AC_FAIL "Cannot generate config.sed helper program"
|
||||
- fi
|
||||
-}
|
||||
-
|
||||
#
|
||||
# AC_SUB writes a substitution into config.sub
|
||||
AC_SUB() {
|
||||
@@ -1788,8 +1742,7 @@ AC_SUB() {
|
||||
|
||||
echo "target=$_target, rest=$*"
|
||||
|
||||
- __ac_config_sed
|
||||
- ./config.sed "$_target" "$*" >> "$__cwd"/config.sub
|
||||
+ config.sed "$_target" "$*" >> "$__cwd"/config.sub
|
||||
}
|
||||
#
|
||||
# AC_TEXT writes arbitrary text into config.h
|
||||
47
machines/ptv/pkgs-cross/discount/default.nix
Normal file
47
machines/ptv/pkgs-cross/discount/default.nix
Normal file
@@ -0,0 +1,47 @@
|
||||
final: prev: let
|
||||
config-sed = prev.buildPackages.stdenv.mkDerivation {
|
||||
name = "orc-discount-config-sed";
|
||||
src = ./config-sed.c;
|
||||
dontUnpack = true;
|
||||
buildPhase = ''
|
||||
$CC -o config.sed $src
|
||||
'';
|
||||
installPhase = ''
|
||||
mkdir -p $out/bin
|
||||
chmod +x ./config.sed
|
||||
mv config.sed $out/bin
|
||||
'';
|
||||
};
|
||||
in prev.discount.overrideAttrs (old: let
|
||||
patches = [
|
||||
./config-sed.patch
|
||||
./make-fix.patch
|
||||
] ++ old.patches;
|
||||
orc-tools = prev.buildPackages.stdenv.mkDerivation {
|
||||
name = "orc-discount-tools";
|
||||
src = old.src;
|
||||
inherit patches;
|
||||
configureScript = old.configureScript;
|
||||
configureFlags = old.configureFlags;
|
||||
buildPhase = ''
|
||||
$CC -o mktags mktags.c
|
||||
$CC -I ./ -o branch tools/branch.c
|
||||
'';
|
||||
installPhase = ''
|
||||
mkdir -p $out/bin
|
||||
mv mktags $out/bin
|
||||
mv branch $out/bin
|
||||
'';
|
||||
};
|
||||
in {
|
||||
# ./configure does not support autoconf-style --build=/--host=.
|
||||
configurePlatforms = [ ];
|
||||
depsBuildBuild = [
|
||||
config-sed
|
||||
orc-tools
|
||||
prev.buildPackages.coreutils
|
||||
];
|
||||
nativeBuildInputs = [
|
||||
];
|
||||
inherit patches;
|
||||
})
|
||||
58
machines/ptv/pkgs-cross/discount/make-fix.patch
Normal file
58
machines/ptv/pkgs-cross/discount/make-fix.patch
Normal file
@@ -0,0 +1,58 @@
|
||||
diff --git a/Makefile.in b/Makefile.in
|
||||
index 085fbd5..e59d769 100644
|
||||
--- a/Makefile.in
|
||||
+++ b/Makefile.in
|
||||
@@ -29,7 +29,7 @@ OBJS=mkdio.o markdown.o dumptree.o generate.o \
|
||||
xml.o Csio.o xmlpage.o basename.o emmatch.o \
|
||||
github_flavoured.o setup.o tags.o html5.o \
|
||||
@AMALLOC@ @H1TITLE@ flags.o
|
||||
-TESTFRAMEWORK=echo cols branch pandoc_headers
|
||||
+TESTFRAMEWORK=echo cols pandoc_headers
|
||||
|
||||
# modules that markdown, makepage, mkd2html, &tc use
|
||||
COMMON=pgm_options.o gethopt.o notspecial.o
|
||||
@@ -84,19 +84,16 @@ $(DESTDIR)$(LIBDIR):
|
||||
@MK_PKGCONFIG@$(DESTDIR)$(PKGDIR):
|
||||
@MK_PKGCONFIG@ $(INSTALL_DIR) $(DESTDIR)$(PKGDIR)
|
||||
|
||||
-version.o: version.c VERSION branch
|
||||
- $(BUILD) -DBRANCH=`./branch` -DVERSION=\"`cat VERSION`\" -c version.c
|
||||
+version.o: version.c VERSION
|
||||
+ $(BUILD) -DBRANCH=`branch` -DVERSION=\"`cat VERSION`\" -c version.c
|
||||
|
||||
VERSION:
|
||||
@true
|
||||
|
||||
tags.o: tags.c cstring.h tags.h blocktags
|
||||
|
||||
-blocktags: mktags
|
||||
- ./mktags > blocktags
|
||||
-
|
||||
-mktags: mktags.o
|
||||
- $(LINK) -o mktags mktags.o
|
||||
+blocktags:
|
||||
+ mktags > blocktags
|
||||
|
||||
# example programs
|
||||
@THEME@theme: theme.o $(COMMON) $(MKDLIB) mkdio.h
|
||||
@@ -143,11 +140,6 @@ pandoc_headers.o: tools/pandoc_headers.c config.h
|
||||
pandoc_headers: pandoc_headers.o $(COMMON) $(MKDLIB)
|
||||
$(LINK) -o pandoc_headers pandoc_headers.o $(COMMON) -lmarkdown
|
||||
|
||||
-branch.o: tools/branch.c config.h
|
||||
- $(BUILD) -c -o branch.o tools/branch.c
|
||||
-branch: branch.o
|
||||
- $(LINK) -o branch branch.o
|
||||
-
|
||||
cols.o: tools/cols.c config.h
|
||||
$(BUILD) -c -o cols.o tools/cols.c
|
||||
cols: cols.o
|
||||
@@ -163,7 +155,7 @@ clean:
|
||||
rm -f $(MKDLIB) `./librarian.sh files $(MKDLIB) VERSION`
|
||||
|
||||
distclean spotless: clean
|
||||
- @DISTCLEAN@ @GENERATED_FILES@ @CONFIGURE_FILES@ ./mktags ./blocktags
|
||||
+ @DISTCLEAN@ @GENERATED_FILES@ @CONFIGURE_FILES@ ./blocktags
|
||||
|
||||
Csio.o: Csio.c cstring.h amalloc.h config.h markdown.h
|
||||
amalloc.o: amalloc.c
|
||||
13
machines/ptv/pkgs-cross/discount/where-tr.patch
Normal file
13
machines/ptv/pkgs-cross/discount/where-tr.patch
Normal file
@@ -0,0 +1,13 @@
|
||||
diff --git a/configure.inc b/configure.inc
|
||||
index fd0c9ba..7ea98e6 100755
|
||||
--- a/configure.inc
|
||||
+++ b/configure.inc
|
||||
@@ -1830,7 +1830,7 @@ AC_QUIET() {
|
||||
}
|
||||
|
||||
|
||||
-AC_TR=`acLookFor tr`
|
||||
+AC_TR=`which tr`
|
||||
if [ "$AC_TR" ]; then
|
||||
# try posix-style tr
|
||||
ABC=`echo abc | tr abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ`
|
||||
19
machines/ptv/pkgs-cross/fwupd-efi/default.nix
Normal file
19
machines/ptv/pkgs-cross/fwupd-efi/default.nix
Normal file
@@ -0,0 +1,19 @@
|
||||
(final: prev:
|
||||
prev.fwupd-efi.overrideAttrs (old: {
|
||||
mesonFlags = old.mesonFlags ++ [
|
||||
# Use this instead of patch, however it points to proper binary
|
||||
"-Defi-cc=${prev.stdenv.cc.targetPrefix}cc"
|
||||
];
|
||||
preBuild = ''
|
||||
cp ${prev.gnu-efi}/lib/*.lds ../efi/lds
|
||||
'';
|
||||
patches = [
|
||||
(prev.fetchurl {
|
||||
url = "https://github.com/fwupd/fwupd-efi/commit/986a6e3beee6b951ca3622f47ed991e0e11c065c.diff";
|
||||
hash = "sha256-UKerVzSn28QSoca6m2igVM6ai8i3B2jyB52B6e/HV5A=";
|
||||
})
|
||||
# ./efi-meson.patch
|
||||
];
|
||||
})
|
||||
)
|
||||
|
||||
13
machines/ptv/pkgs-cross/fwupd-efi/efi-meson.patch
Normal file
13
machines/ptv/pkgs-cross/fwupd-efi/efi-meson.patch
Normal file
@@ -0,0 +1,13 @@
|
||||
diff --git a/efi/meson.build b/efi/meson.build
|
||||
index 936ba3c..53687b1 100644
|
||||
--- a/efi/meson.build
|
||||
+++ b/efi/meson.build
|
||||
@@ -1,7 +1,7 @@
|
||||
generate_sbat = find_program('generate_sbat.py', native: true)
|
||||
generate_binary = find_program('generate_binary.py', native: true)
|
||||
|
||||
-efi_cc = get_option('efi-cc')
|
||||
+efi_cc = run_command('sh', '-c', 'echo $CC')
|
||||
efi_ld = get_option('efi-ld')
|
||||
efi_ldsdir = get_option('efi-ldsdir')
|
||||
efi_incdir = get_option('efi-includedir')
|
||||
14
machines/ptv/pkgs-cross/fwupd-efi/meson-rv64.patch
Normal file
14
machines/ptv/pkgs-cross/fwupd-efi/meson-rv64.patch
Normal file
@@ -0,0 +1,14 @@
|
||||
diff --git a/meson.build b/meson.build
|
||||
index 7d59695..b82bcdf 100644
|
||||
--- a/meson.build
|
||||
+++ b/meson.build
|
||||
@@ -31,6 +31,9 @@ elif host_cpu == 'arm'
|
||||
elif host_cpu == 'aarch64'
|
||||
EFI_MACHINE_TYPE_NAME = 'aa64'
|
||||
gnu_efi_arch = 'aarch64'
|
||||
+elif host_cpu == 'riscv64'
|
||||
+ EFI_MACHINE_TYPE_NAME = '.'
|
||||
+ gnu_efi_arch = 'riscv64'
|
||||
else
|
||||
error('Unknown host_cpu ' + host_cpu)
|
||||
endif
|
||||
10
machines/ptv/pkgs-cross/gn/default.nix
Normal file
10
machines/ptv/pkgs-cross/gn/default.nix
Normal file
@@ -0,0 +1,10 @@
|
||||
# TODO: gn-unstable needs rev newer than 2021-01-28
|
||||
# 713a1850957b919c876c924e43ef0ddc4d8a8144 for riscv64 support
|
||||
|
||||
final: prev: prev.gn.overrideAttrs (old: {
|
||||
src = prev.fetchgit {
|
||||
url = "https://gn.googlesource.com/gn";
|
||||
rev = "713a1850957b919c876c924e43ef0ddc4d8a8144";
|
||||
hash = "sha256-yzx7wPp/PEwGg4HZ99YntyHJ384nTVq6fyB6/vOOvOM=";
|
||||
};
|
||||
})
|
||||
4
machines/ptv/pkgs-cross/gnugrep/default.nix
Normal file
4
machines/ptv/pkgs-cross/gnugrep/default.nix
Normal file
@@ -0,0 +1,4 @@
|
||||
|
||||
final: prev: prev.gnugrep.overrideAttrs (old: {
|
||||
doCheck = false; #prev.stdenv.hostPlatform != "riscv64-linux";
|
||||
})
|
||||
5
machines/ptv/pkgs-cross/libdrm/default.nix
Normal file
5
machines/ptv/pkgs-cross/libdrm/default.nix
Normal file
@@ -0,0 +1,5 @@
|
||||
final: prev: prev.libdrm.overrideAttrs (old: {
|
||||
buildInputs = old.buildInputs ++ [
|
||||
final.libatomic_ops
|
||||
];
|
||||
})
|
||||
8
machines/ptv/pkgs-cross/live555/default.nix
Normal file
8
machines/ptv/pkgs-cross/live555/default.nix
Normal file
@@ -0,0 +1,8 @@
|
||||
final: prev: prev.live555.overrideAttrs (old: {
|
||||
preConfigure = (prev.lib.optional (prev.stdenv.hostPlatform != prev.stdenv.buildPlatform) ''
|
||||
sed -e 's/^C_COMPILER.*=.*$/C_COMPILER = $(CC)/g' -i config.*
|
||||
sed -e 's/^CPLUSPLUS_COMPILER.*=.*$/CPLUSPLUS_COMPILER = $(CXX)/g' -i config.*
|
||||
sed -e 's/^LINK.*=.*$/LINK = $(CXX) -o/g' -i config.*
|
||||
sed -e 's/^LIBRARY_LINK.*=.*$/LIBRARY_LINK = $(AR) cr /g' -i config.*
|
||||
'');
|
||||
})
|
||||
5
machines/ptv/pkgs-cross/openfortivpn/default.nix
Normal file
5
machines/ptv/pkgs-cross/openfortivpn/default.nix
Normal file
@@ -0,0 +1,5 @@
|
||||
final: prev: prev.openfortivpn.overrideAttrs (old: {
|
||||
configureFlags = old.configureFlags ++ prev.lib.optionals (prev.stdenv.hostPlatform != prev.stdenv.buildPlatform) [
|
||||
"--disable-proc"
|
||||
];
|
||||
})
|
||||
42
machines/ptv/pkgs-cross/perlTestutf8/default.nix
Normal file
42
machines/ptv/pkgs-cross/perlTestutf8/default.nix
Normal file
@@ -0,0 +1,42 @@
|
||||
final: prev: prev.perl538Packages.Testutf8.overrideAttrs (old: let
|
||||
perl = final.perl538;
|
||||
in {
|
||||
postInstall = prev.lib.optionalString (prev.stdenv.buildPlatform != prev.stdenv.hostPlatform) ''
|
||||
mkdir -p $out/${perl.libPrefix}/cross_perl/${perl.version}/DBI
|
||||
cat > $out/${perl.libPrefix}/cross_perl/${perl.version}/DBI.pm <<EOF
|
||||
package DBI;
|
||||
BEGIN {
|
||||
our \$VERSION = "$version";
|
||||
}
|
||||
1;
|
||||
EOF
|
||||
|
||||
autodir=$(echo $out/${perl.libPrefix}/${perl.version}/*/auto/DBI)
|
||||
cat > $out/${perl.libPrefix}/cross_perl/${perl.version}/DBI/DBD.pm <<EOF
|
||||
package DBI::DBD;
|
||||
use Exporter ();
|
||||
use vars qw (@ISA @EXPORT);
|
||||
@ISA = qw(Exporter);
|
||||
@EXPORT = qw(dbd_postamble);
|
||||
sub dbd_postamble {
|
||||
return '
|
||||
# --- This section was generated by DBI::DBD::dbd_postamble()
|
||||
DBI_INSTARCH_DIR=$autodir
|
||||
DBI_DRIVER_XST=$autodir/Driver.xst
|
||||
|
||||
# The main dependency (technically correct but probably not used)
|
||||
\$(BASEEXT).c: \$(BASEEXT).xsi
|
||||
|
||||
# This dependency is needed since MakeMaker uses the .xs.o rule
|
||||
\$(BASEEXT)\$(OBJ_EXT): \$(BASEEXT).xsi
|
||||
|
||||
\$(BASEEXT).xsi: \$(DBI_DRIVER_XST) $autodir/Driver_xst.h
|
||||
''\t\$(PERL) -p -e "s/~DRIVER~/\$(BASEEXT)/g" \$(DBI_DRIVER_XST) > \$(BASEEXT).xsi
|
||||
|
||||
# ---
|
||||
';
|
||||
}
|
||||
1;
|
||||
EOF
|
||||
'';
|
||||
})
|
||||
11
machines/ptv/pkgs-cross/protobuf/default.nix
Normal file
11
machines/ptv/pkgs-cross/protobuf/default.nix
Normal file
@@ -0,0 +1,11 @@
|
||||
final: prev: prev.protobuf.overrideAttrs (old: {
|
||||
# https://github.com/advancedtelematic/aktualizr/issues/1427
|
||||
# atomics not supported, need either submit PR like suggested bove
|
||||
# or, for now, use libatomic_ops
|
||||
postPatch = old.postPatch + ''
|
||||
sed -i -e 's/set(protobuf_LINK_LIBATOMIC false)/set(protobuf_LINK_LIBATOMIC true)/' CMakeLists.txt
|
||||
'';
|
||||
buildInputs = [
|
||||
prev.libatomic_ops
|
||||
] ++ old.buildInputs;
|
||||
})
|
||||
15
machines/ptv/pkgs-cross/valgrind/default.nix
Normal file
15
machines/ptv/pkgs-cross/valgrind/default.nix
Normal file
@@ -0,0 +1,15 @@
|
||||
final: prev: prev.valgrind.overrideAttrs (old: {
|
||||
src = prev.fetchFromGitHub {
|
||||
owner = "petrpavlu";
|
||||
repo = "valgrind-riscv64";
|
||||
rev = "71272b252977fe52f03ea4fa8306b457b098cca5";
|
||||
hash = "sha256-xD84dYSzq9eD35NfnmtI/zONVRjhDAEJkge26yFK034=";
|
||||
};
|
||||
outputs = [ "out" ];
|
||||
patches = [
|
||||
(prev.fetchpatch {
|
||||
url = "https://bugsfiles.kde.org/attachment.cgi?id=149173";
|
||||
sha256 = "sha256-jX9hD4utWRebbXMJYZ5mu9jecvdrNP05E5J+PnKRTyQ=";
|
||||
})
|
||||
];
|
||||
})
|
||||
3
machines/ptv/pkgs-cross/vpnc/default.nix
Normal file
3
machines/ptv/pkgs-cross/vpnc/default.nix
Normal file
@@ -0,0 +1,3 @@
|
||||
final: prev: prev.vpnc.overrideAttrs (old: {
|
||||
nativeBuildInputs = old.nativeBuildInputs ++ (prev.lib.optionals (prev.stdenv.hostPlatform != prev.stdenv.buildPlatform) [final.perl]);
|
||||
})
|
||||
7
machines/ptv/pkgs-cross/vulkan-tools/default.nix
Normal file
7
machines/ptv/pkgs-cross/vulkan-tools/default.nix
Normal file
@@ -0,0 +1,7 @@
|
||||
final: prev: prev.vulkan-tools.overrideAttrs (old: {
|
||||
cmakeFlags = old.cmakeFlags ++ (prev.lib.optionals (prev.stdenv.hostPlatform != prev.stdenv.buildPlatform) [
|
||||
"-DBUILD_CUBE=OFF"
|
||||
"-DPKG_CONFIG_EXECUTABLE=${prev.buildPackages.pkg-config}/bin/riscv64-unknown-linux-gnu-pkg-config"
|
||||
]);
|
||||
})
|
||||
|
||||
3
machines/ptv/pkgs/cryptsetup/default.nix
Normal file
3
machines/ptv/pkgs/cryptsetup/default.nix
Normal file
@@ -0,0 +1,3 @@
|
||||
final: prev: prev.cryptsetup.overrideAttrs (old: {
|
||||
doCheck = false;
|
||||
})
|
||||
66
machines/ptv/pkgs/default.nix
Normal file
66
machines/ptv/pkgs/default.nix
Normal file
@@ -0,0 +1,66 @@
|
||||
(final: prev: let
|
||||
noCheck = p: p.overrideAttrs (old: {
|
||||
doCheck = false;
|
||||
});
|
||||
in {
|
||||
valgrind = (import ./valgrind) final prev;
|
||||
valgrind-light = final.valgrind.override { gdb = null; };
|
||||
cryptsetup = (import ./cryptsetup) final prev;
|
||||
libopus = noCheck prev.libopus;
|
||||
gn = (import ./gn) final prev;
|
||||
# Test Times out
|
||||
openexr = noCheck prev.openexr;
|
||||
ell = noCheck prev.ell;
|
||||
# Checks timeout:
|
||||
pixman = noCheck prev.pixman;
|
||||
# Inspired by: https://github.com/systemd/systemd/issues/12534
|
||||
# and https://github.com/systemd/systemd/issues/30448
|
||||
# Seems RISC-V and the like with GCC don't play well with O3
|
||||
systemd = prev.systemd.overrideAttrs (old: {
|
||||
# https://github.com/mesonbuild/meson/issues/10487
|
||||
mesonBuildType = "custom";
|
||||
mesonFlags = old.mesonFlags ++ [ "-Doptimization=2" ];
|
||||
});
|
||||
# See https://github.com/catchorg/Catch2/issues/2808
|
||||
# Fixed by https://github.com/NixOS/nixpkgs/pull/295243
|
||||
catch2_3 = prev.catch2_3.overrideAttrs ({ NIX_CFLAGS_COMPILE ? "", ... }: {
|
||||
NIX_CFLAGS_COMPILE = "${NIX_CFLAGS_COMPILE} -Wno-error=cast-align";
|
||||
});
|
||||
# One test times out
|
||||
json-glib = noCheck prev.json-glib;
|
||||
# Openh264 doesn't support RISC-V (yet)
|
||||
# freerdp requires it by default: lets make that not true
|
||||
freerdp = prev.freerdp.override {
|
||||
openh264 = null;
|
||||
};
|
||||
tracker = noCheck prev.tracker;
|
||||
openblas = prev.openblas.overrideAttrs (old: {
|
||||
postPatch = (old.postPatch or "") + ''
|
||||
sed -i 's/-static//g' Makefile.riscv64
|
||||
'';
|
||||
});
|
||||
python3 = prev.python3.override {
|
||||
packageOverrides = final-py: prev-py: let
|
||||
noCheck = p: p.overridePythonAttrs (old: {
|
||||
doCheck = false;
|
||||
});
|
||||
in {
|
||||
dbus-python = prev-py.dbus-python.overridePythonAttrs (old: {
|
||||
nativeBuildInputs = old.nativeBuildInputs ++ [ final.dbus ];
|
||||
doCheck = false;
|
||||
});
|
||||
hypothesis = noCheck prev-py.hypothesis;
|
||||
h2 = noCheck prev-py.h2;
|
||||
numpy = prev-py.numpy.overridePythonAttrs (old: {
|
||||
doCheck = false;
|
||||
});
|
||||
# https://github.com/pandas-dev/pandas/pull/50349 <-- This
|
||||
# but for risc-v
|
||||
pandas = noCheck prev-py.pandas;
|
||||
sphinx = noCheck prev-py.sphinx;
|
||||
#skia-pathops = prev.skia-pathops.overridePythonAttrs (old: {
|
||||
# patches = old.patches or [] ++ [ ./skia-riscv.patch ];
|
||||
#});
|
||||
};
|
||||
};
|
||||
})
|
||||
10
machines/ptv/pkgs/gn/default.nix
Normal file
10
machines/ptv/pkgs/gn/default.nix
Normal file
@@ -0,0 +1,10 @@
|
||||
# TODO: gn-unstable needs rev newer than 2021-01-28
|
||||
# 713a1850957b919c876c924e43ef0ddc4d8a8144 for riscv64 support
|
||||
|
||||
final: prev: prev.gn.overrideAttrs (old: {
|
||||
src = prev.fetchgit {
|
||||
url = "https://gn.googlesource.com/gn";
|
||||
rev = "713a1850957b919c876c924e43ef0ddc4d8a8144";
|
||||
hash = "sha256-yzx7wPp/PEwGg4HZ99YntyHJ384nTVq6fyB6/vOOvOM=";
|
||||
};
|
||||
})
|
||||
15
machines/ptv/pkgs/valgrind/default.nix
Normal file
15
machines/ptv/pkgs/valgrind/default.nix
Normal file
@@ -0,0 +1,15 @@
|
||||
final: prev: prev.valgrind.overrideAttrs (old: {
|
||||
src = prev.fetchFromGitHub {
|
||||
owner = "petrpavlu";
|
||||
repo = "valgrind-riscv64";
|
||||
rev = "71272b252977fe52f03ea4fa8306b457b098cca5";
|
||||
hash = "sha256-xD84dYSzq9eD35NfnmtI/zONVRjhDAEJkge26yFK034=";
|
||||
};
|
||||
outputs = [ "out" ];
|
||||
patches = [
|
||||
(prev.fetchpatch {
|
||||
url = "https://bugsfiles.kde.org/attachment.cgi?id=149173";
|
||||
sha256 = "sha256-jX9hD4utWRebbXMJYZ5mu9jecvdrNP05E5J+PnKRTyQ=";
|
||||
})
|
||||
];
|
||||
})
|
||||
BIN
machines/ptv/rgx-img-gpu-firmware.tar.gz
Normal file
BIN
machines/ptv/rgx-img-gpu-firmware.tar.gz
Normal file
Binary file not shown.
Reference in New Issue
Block a user