uboot: (firmwareOdroidC2/C4) don't invoke patch tool, use patches = [] instead
https://github.com/NixOS/nixpkgs/blob/master/pkgs/stdenv/generic/setup.sh#L948 this can do it nicely. Signed-off-by: Anton Arapov <anton@deadbeef.mx>
This commit is contained in:
commit
56de2bcd43
30691 changed files with 3076956 additions and 0 deletions
|
|
@ -0,0 +1,42 @@
|
|||
From 8ed5f3c9117e08f7c2e4e1e01c2eee501675049b Mon Sep 17 00:00:00 2001
|
||||
From: Maximilian Bosch <maximilian@mbosch.me>
|
||||
Date: Sat, 26 Feb 2022 12:33:13 +0100
|
||||
Subject: [PATCH] Fetch buildconfig during gradle build inside Nix FOD
|
||||
|
||||
---
|
||||
build.gradle | 7 ++++++-
|
||||
1 file changed, 6 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/build.gradle b/build.gradle
|
||||
index eaa6e0e..63c2947 100644
|
||||
--- a/build.gradle
|
||||
+++ b/build.gradle
|
||||
@@ -83,6 +83,9 @@ static String getVersion() {
|
||||
|
||||
repositories {
|
||||
maven {url "https://gitlab.com/api/v4/groups/6853927/-/packages/maven"} // https://gitlab.com/groups/signald/-/packages
|
||||
+ maven {
|
||||
+ url "https://plugins.gradle.org/m2/"
|
||||
+ }
|
||||
mavenCentral()
|
||||
}
|
||||
|
||||
@@ -104,6 +107,8 @@ dependencies {
|
||||
implementation 'io.prometheus:simpleclient_httpserver:0.15.0'
|
||||
implementation 'com.squareup.okhttp3:logging-interceptor:4.9.3'
|
||||
implementation 'io.sentry:sentry:5.7.3'
|
||||
+ implementation 'com.github.gmazzo.buildconfig:com.github.gmazzo.buildconfig.gradle.plugin:3.0.3'
|
||||
+ implementation 'org.jetbrains.kotlin:kotlin-scripting-jvm:1.4.31'
|
||||
testImplementation 'org.junit.jupiter:junit-jupiter:5.8.2'
|
||||
}
|
||||
|
||||
@@ -171,4 +176,4 @@ allprojects {
|
||||
runtime {
|
||||
options = ['--strip-java-debug-attributes', '--compress', '2', '--no-header-files', '--no-man-pages']
|
||||
modules = ['java.base', 'java.management', 'java.naming', 'java.sql', 'java.xml', 'jdk.crypto.ec', 'jdk.httpserver', 'java.desktop', 'jdk.unsupported']
|
||||
-}
|
||||
\ No newline at end of file
|
||||
+}
|
||||
--
|
||||
2.36.0
|
||||
|
||||
|
|
@ -0,0 +1,71 @@
|
|||
From f319e1db47ae1eeddb6021cafe7b4f8551a702d7 Mon Sep 17 00:00:00 2001
|
||||
From: Maximilian Bosch <maximilian@mbosch.me>
|
||||
Date: Sat, 26 Feb 2022 12:36:15 +0100
|
||||
Subject: [PATCH 2/2] buildconfig/local deps fixes
|
||||
|
||||
---
|
||||
build.gradle | 26 ++++++++++++++++++--------
|
||||
1 file changed, 18 insertions(+), 8 deletions(-)
|
||||
|
||||
diff --git a/build.gradle b/build.gradle
|
||||
index eaa6e0e..9a2f4e2 100644
|
||||
--- a/build.gradle
|
||||
+++ b/build.gradle
|
||||
@@ -10,11 +10,21 @@ import org.gradle.nativeplatform.platform.internal.ArchitectureInternal
|
||||
import org.gradle.nativeplatform.platform.internal.DefaultNativePlatform
|
||||
import org.gradle.nativeplatform.platform.internal.OperatingSystemInternal
|
||||
|
||||
+buildscript {
|
||||
+ repositories {
|
||||
+ maven {
|
||||
+ url(uri("@deps@"))
|
||||
+ }
|
||||
+ }
|
||||
+ dependencies {
|
||||
+ classpath "com.github.gmazzo:gradle-buildconfig-plugin:3.0.3"
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
plugins {
|
||||
- id 'com.github.gmazzo.buildconfig' version '3.0.3'
|
||||
- id 'org.beryx.runtime' version '1.12.7'
|
||||
id 'application'
|
||||
}
|
||||
+apply plugin: "com.github.gmazzo.buildconfig"
|
||||
|
||||
compileJava.options.encoding = 'UTF-8'
|
||||
|
||||
@@ -83,7 +93,10 @@ static String getVersion() {
|
||||
|
||||
repositories {
|
||||
maven {url "https://gitlab.com/api/v4/groups/6853927/-/packages/maven"} // https://gitlab.com/groups/signald/-/packages
|
||||
- mavenCentral()
|
||||
+ mavenLocal()
|
||||
+ maven {
|
||||
+ url uri("@deps@")
|
||||
+ }
|
||||
}
|
||||
|
||||
dependencies {
|
||||
@@ -104,6 +117,8 @@ dependencies {
|
||||
implementation 'io.prometheus:simpleclient_httpserver:0.15.0'
|
||||
implementation 'com.squareup.okhttp3:logging-interceptor:4.9.3'
|
||||
implementation 'io.sentry:sentry:5.7.3'
|
||||
+ implementation 'com.github.gmazzo.buildconfig:com.github.gmazzo.buildconfig.gradle.plugin:3.0.3'
|
||||
+ implementation 'org.jetbrains.kotlin:kotlin-scripting-jvm:1.4.31'
|
||||
testImplementation 'org.junit.jupiter:junit-jupiter:5.8.2'
|
||||
}
|
||||
|
||||
@@ -167,8 +182,3 @@ allprojects {
|
||||
}
|
||||
}
|
||||
}
|
||||
-
|
||||
-runtime {
|
||||
- options = ['--strip-java-debug-attributes', '--compress', '2', '--no-header-files', '--no-man-pages']
|
||||
- modules = ['java.base', 'java.management', 'java.naming', 'java.sql', 'java.xml', 'jdk.crypto.ec', 'jdk.httpserver', 'java.desktop', 'jdk.unsupported']
|
||||
-}
|
||||
\ No newline at end of file
|
||||
--
|
||||
2.36.0
|
||||
|
||||
|
|
@ -0,0 +1,114 @@
|
|||
{ lib, stdenv, fetchurl, fetchFromGitLab, jdk17_headless, coreutils, gradle_6, git, perl
|
||||
, makeWrapper, fetchpatch, substituteAll, jre_minimal
|
||||
}:
|
||||
|
||||
let
|
||||
pname = "signald";
|
||||
version = "0.18.5";
|
||||
|
||||
src = fetchFromGitLab {
|
||||
owner = pname;
|
||||
repo = pname;
|
||||
rev = version;
|
||||
sha256 = "sha256-2cb1pyBOoOlFqJsNKXA0Q9x4wCE4yzzcfrDDtTp7HMk=";
|
||||
};
|
||||
|
||||
jre' = jre_minimal.override {
|
||||
jdk = jdk17_headless;
|
||||
# from https://gitlab.com/signald/signald/-/blob/0.18.5/build.gradle#L173
|
||||
modules = [
|
||||
"java.base"
|
||||
"java.management"
|
||||
"java.naming"
|
||||
"java.sql"
|
||||
"java.xml"
|
||||
"jdk.crypto.ec"
|
||||
"jdk.httpserver"
|
||||
|
||||
# for java/beans/PropertyChangeEvent
|
||||
"java.desktop"
|
||||
# for sun/misc/Unsafe
|
||||
"jdk.unsupported"
|
||||
];
|
||||
};
|
||||
|
||||
# fake build to pre-download deps into fixed-output derivation
|
||||
deps = stdenv.mkDerivation {
|
||||
pname = "${pname}-deps";
|
||||
inherit src version;
|
||||
nativeBuildInputs = [ gradle_6 perl ];
|
||||
patches = [ ./0001-Fetch-buildconfig-during-gradle-build-inside-Nix-FOD.patch ];
|
||||
buildPhase = ''
|
||||
export GRADLE_USER_HOME=$(mktemp -d)
|
||||
gradle --no-daemon build
|
||||
'';
|
||||
# perl code mavenizes pathes (com.squareup.okio/okio/1.13.0/a9283170b7305c8d92d25aff02a6ab7e45d06cbe/okio-1.13.0.jar -> com/squareup/okio/okio/1.13.0/okio-1.13.0.jar)
|
||||
installPhase = ''
|
||||
find $GRADLE_USER_HOME/caches/modules-2 -type f -regex '.*\.\(jar\|pom\)' \
|
||||
| perl -pe 's#(.*/([^/]+)/([^/]+)/([^/]+)/[0-9a-f]{30,40}/([^/\s]+))$# ($x = $2) =~ tr|\.|/|; "install -Dm444 $1 \$out/$x/$3/$4/''${\($5 =~ s/okio-jvm/okio/r)}" #e' \
|
||||
| sh
|
||||
'';
|
||||
# Don't move info to share/
|
||||
forceShare = [ "dummy" ];
|
||||
outputHashAlgo = "sha256";
|
||||
outputHashMode = "recursive";
|
||||
# Downloaded jars differ by platform
|
||||
outputHash = {
|
||||
x86_64-linux = "sha256-q1gzauIL7aKalvPSfiK5IvkNkidCh+6jp5bpwxR+PZ0=";
|
||||
aarch64-linux = "sha256-cM+7MaV0/4yAzobXX9FSdl/ZfLddwySayao96UdDgzk=";
|
||||
}.${stdenv.system} or (throw "Unsupported platform");
|
||||
};
|
||||
|
||||
in stdenv.mkDerivation rec {
|
||||
inherit pname src version;
|
||||
|
||||
patches = [
|
||||
(substituteAll {
|
||||
src = ./0002-buildconfig-local-deps-fixes.patch;
|
||||
inherit deps;
|
||||
})
|
||||
];
|
||||
|
||||
buildPhase = ''
|
||||
runHook preBuild
|
||||
|
||||
export GRADLE_USER_HOME=$(mktemp -d)
|
||||
|
||||
gradle --offline --no-daemon distTar
|
||||
|
||||
runHook postBuild
|
||||
'';
|
||||
|
||||
installPhase = ''
|
||||
runHook preInstall
|
||||
|
||||
mkdir -p $out
|
||||
tar xvf ./build/distributions/signald.tar --strip-components=1 --directory $out/
|
||||
wrapProgram $out/bin/signald \
|
||||
--prefix PATH : ${lib.makeBinPath [ coreutils ]} \
|
||||
--set JAVA_HOME "${jre'}"
|
||||
|
||||
runHook postInstall
|
||||
'';
|
||||
|
||||
nativeBuildInputs = [ git gradle_6 makeWrapper ];
|
||||
|
||||
doCheck = true;
|
||||
|
||||
meta = with lib; {
|
||||
description = "Unofficial daemon for interacting with Signal";
|
||||
longDescription = ''
|
||||
Signald is a daemon that facilitates communication over Signal. It is
|
||||
unofficial, unapproved, and not nearly as secure as the real Signal
|
||||
clients.
|
||||
'';
|
||||
homepage = "https://signald.org";
|
||||
sourceProvenance = with sourceTypes; [
|
||||
fromSource
|
||||
binaryBytecode # deps
|
||||
];
|
||||
license = licenses.gpl3Plus;
|
||||
maintainers = with maintainers; [ expipiplus1 ma27 ];
|
||||
platforms = [ "x86_64-linux" "aarch64-linux" ];
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue