fix android build and add refman build

This commit is contained in:
Morten Delenk 2022-08-13 21:04:02 +01:00
parent 99376c9957
commit 90ed6cfc2a
No known key found for this signature in database
GPG key ID: 5130416C797067B6
3 changed files with 47 additions and 5 deletions

View file

@ -67,7 +67,7 @@ PROJECT_LOGO =
# entered, it will be relative to the location where doxygen was started. If
# left blank the current directory will be used.
OUTPUT_DIRECTORY = /home/darkkirb/AndroidStudioProjects/Invtracker/doc
OUTPUT_DIRECTORY = ./doc
# If the CREATE_SUBDIRS tag is set to YES then doxygen will create up to 4096
# sub-directories (in 2 levels) under the output directory of each output format
@ -906,7 +906,7 @@ WARN_LOGFILE =
# spaces. See also FILE_PATTERNS and EXTENSION_MAPPING
# Note: If this tag is empty the current directory is searched.
INPUT = /home/darkkirb/AndroidStudioProjects/Invtracker
INPUT =
# This tag can be used to specify the character encoding of the source files
# that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses

28
doc.nix Normal file
View file

@ -0,0 +1,28 @@
{ self, stdenvNoCC, doxygen, graphviz, texlive-env, gnumake }: let
doxygen-step = stdenvNoCC.mkDerivation {
pname = "invtracker-doxygen";
version = self.lastModifiedDate;
src = self;
nativeBuildInputs = [doxygen graphviz];
buildPhase = ''
doxygen
find doc/latex -name '*.tex' | xargs sed -i 's/\\newline/\\newline{}/g'
'';
installPhase = ''
cp -rv doc $out
'';
};
refman = stdenvNoCC.mkDerivation {
name = "invtracker-refman-${self.lastModifiedDate}.pdf";
pname = "invtracker-refman";
version = self.lastModifiedDate;
src = doxygen-step;
nativeBuildInputs = [gnumake texlive-env];
buildPhase = ''
make -C latex LATEX_CMD=xelatex
'';
installPhase = ''
cp -v latex/refman.pdf $out
'';
};
in refman

View file

@ -19,6 +19,15 @@
allowUnfree = true;
};
};
texlive-env = (pkgs.texlive.combine {
inherit (pkgs.texlive) scheme-basic
xetex
float xcolor varwidth fancyvrb multirow hanging adjustbox stackengine
enumitem alphalph ulem xkeyval collectbox etoolbox wasysym sectsty
tocloft newunicodechar caption etoc psnfss metafont helvetic courier
wasy wasy-type1
;
});
in rec {
formatter = pkgs.alejandra;
devShells.default = let
@ -30,7 +39,7 @@
glibc
doxygen
graphviz
texlive.combined.scheme-full
texlive-env
];
# override the aapt2 that gradle uses with the nix-shipped version
GRADLE_OPTS = "-Dorg.gradle.project.android.aapt2FromMavenOverride=${androidSdk}/libexec/android-sdk/build-tools/32.0.0/aapt2";
@ -71,16 +80,20 @@
cp -rv server/build/install/server $out/
'';
};
invtracker-client = pkgs.stdenv.mkDerivation rec {
invtracker-client = let
androidSdk = pkgs.androidenv.androidPkgs_9_0.androidsdk;
in
pkgs.stdenv.mkDerivation rec {
pname = "invtracker-client";
version = self.lastModifiedDate;
src = self;
nativeBuildInputs = with pkgs; [gradle openjdk_headless androidenv.androidPkgs_9_0.androidsdk ];
nativeBuildInputs = with pkgs; [gradle openjdk_headless androidSdk ];
buildPhase = ''
sed -i 's#gradlePluginPortal..#maven { url "${invtracker-deps}/maven" }#' settings.gradle
sed -i 's#google..#maven { url "${invtracker-deps}/maven" }#' settings.gradle
export GRADLE_USER_HOME=$(mktemp -d)
export ANDROID_HOME=${androidSdk}
gradle --offline --no-daemon --info -Dorg.gradle.java.home=${pkgs.openjdk_headless} app:build
'';
installPhase = ''
@ -91,6 +104,7 @@
echo "$pname-$version" > $out/nix-support/hydra-release-name
'';
};
invtracker-docs = pkgs.callPackage ./doc.nix { inherit self texlive-env; };
};
hydraJobs =