WIP nix builds
Not working, needs a separate gomuks build
This commit is contained in:
parent
0cae2692bc
commit
04b7ab8e2e
7 changed files with 94 additions and 56 deletions
30
flake.nix
30
flake.nix
|
|
@ -2,6 +2,7 @@
|
|||
description = "Nexus Flutter Flake";
|
||||
|
||||
inputs = {
|
||||
self.submodules = true;
|
||||
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
|
||||
flake-parts.url = "github:hercules-ci/flake-parts";
|
||||
};
|
||||
|
|
@ -38,32 +39,11 @@
|
|||
};
|
||||
};
|
||||
|
||||
devShells.default =
|
||||
let
|
||||
android = pkgs.callPackage ./nix/android.nix { };
|
||||
in
|
||||
pkgs.mkShell {
|
||||
packages = with pkgs; [
|
||||
go
|
||||
git
|
||||
jdk17
|
||||
flutter
|
||||
android.platform-tools
|
||||
];
|
||||
packages.default = pkgs.callPackage ./linux/nix/package.nix {
|
||||
src = self;
|
||||
};
|
||||
|
||||
env = rec {
|
||||
LIBCLANG_PATH = lib.makeLibraryPath [ pkgs.libclang ];
|
||||
LD_LIBRARY_PATH = "./build/native_assets/linux:${lib.makeLibraryPath [ pkgs.zlib ]}";
|
||||
CPATH = lib.makeSearchPath "include" [ pkgs.glibc.dev ];
|
||||
|
||||
ANDROID_HOME = "${android.androidsdk}/libexec/android-sdk";
|
||||
ANDROID_SDK_ROOT = ANDROID_HOME;
|
||||
JAVA_HOME = pkgs.jdk17;
|
||||
|
||||
TOOLS = "${ANDROID_HOME}/build-tools/${"36.0.0"}";
|
||||
GRADLE_OPTS = "-Dorg.gradle.project.android.aapt2FromMavenOverride=${TOOLS}/aapt2";
|
||||
};
|
||||
};
|
||||
devShells.default = pkgs.callPackage ./linux/nix/devshell.nix { };
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,9 +3,6 @@ import "package:hooks/hooks.dart";
|
|||
import "package:code_assets/code_assets.dart";
|
||||
|
||||
Future<void> main(List<String> args) => build(args, (input, output) async {
|
||||
final buildDir = input.packageRoot.resolve("build/");
|
||||
if (await File(buildDir.resolve("lock").toFilePath()).exists()) return;
|
||||
|
||||
final codeConfig = input.config.code;
|
||||
final targetOS = codeConfig.targetOS;
|
||||
final targetArch = codeConfig.targetArchitecture;
|
||||
|
|
@ -49,6 +46,7 @@ Future<void> main(List<String> args) => build(args, (input, output) async {
|
|||
throw UnsupportedError("Unsupported OS: $targetOS");
|
||||
}
|
||||
|
||||
final buildDir = input.packageRoot.resolve("build/");
|
||||
final gomuksBuildDir = input.packageRoot.resolve("gomuks/");
|
||||
final libFile = buildDir.resolve("${targetArch.name}/$libFileName");
|
||||
|
||||
|
|
|
|||
8
linux/nexus.desktop
Normal file
8
linux/nexus.desktop
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
[Desktop Entry]
|
||||
Name=Nexus
|
||||
Comment=A simple and user-friendly Matrix client
|
||||
Exec=nexus
|
||||
Icon=nexus
|
||||
Terminal=false
|
||||
Type=Application
|
||||
Categories=Chat;Network;InstantMessaging;
|
||||
41
linux/nix/devshell.nix
Normal file
41
linux/nix/devshell.nix
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
{ pkgs, lib }:
|
||||
let
|
||||
android = pkgs.androidenv.composeAndroidPackages {
|
||||
toolsVersion = "26.1.1";
|
||||
platformToolsVersion = "36.0.1";
|
||||
buildToolsVersions = [
|
||||
"35.0.0"
|
||||
"36.0.0"
|
||||
];
|
||||
cmakeVersions = [ "3.22.1" ];
|
||||
platformVersions = [ "36" ];
|
||||
abiVersions = [
|
||||
"armeabi-v7a"
|
||||
"arm64-v8a"
|
||||
];
|
||||
includeNDK = true;
|
||||
ndkVersions = [ "28.2.13676358" ];
|
||||
};
|
||||
in
|
||||
pkgs.mkShell {
|
||||
packages = with pkgs; [
|
||||
go
|
||||
git
|
||||
jdk17
|
||||
flutter
|
||||
android.platform-tools
|
||||
];
|
||||
|
||||
env = rec {
|
||||
LIBCLANG_PATH = lib.makeLibraryPath [ pkgs.libclang ];
|
||||
LD_LIBRARY_PATH = "./build/native_assets/linux:${lib.makeLibraryPath [ pkgs.zlib ]}";
|
||||
CPATH = lib.makeSearchPath "include" [ pkgs.glibc.dev ];
|
||||
|
||||
ANDROID_HOME = "${android.androidsdk}/libexec/android-sdk";
|
||||
ANDROID_SDK_ROOT = ANDROID_HOME;
|
||||
JAVA_HOME = pkgs.jdk17;
|
||||
|
||||
TOOLS = "${ANDROID_HOME}/build-tools/${"36.0.0"}";
|
||||
GRADLE_OPTS = "-Dorg.gradle.project.android.aapt2FromMavenOverride=${TOOLS}/aapt2";
|
||||
};
|
||||
}
|
||||
39
linux/nix/package.nix
Normal file
39
linux/nix/package.nix
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
{
|
||||
lib,
|
||||
libclang,
|
||||
flutter,
|
||||
src,
|
||||
go,
|
||||
}:
|
||||
|
||||
flutter.buildFlutterApplication {
|
||||
pname = "nexus";
|
||||
version = "0.1.0";
|
||||
inherit src;
|
||||
|
||||
preBuild = ''
|
||||
packageRunCustom nexus generate source/scripts test
|
||||
packageRun build_runner build
|
||||
'';
|
||||
|
||||
env.LIBCLANG_PATH = lib.makeLibraryPath [ libclang ];
|
||||
|
||||
nativeBuildInputs = [
|
||||
go
|
||||
];
|
||||
|
||||
autoPubspecLock = src + "/pubspec.lock";
|
||||
|
||||
gitHashes = {
|
||||
window_size = "sha256-XelNtp7tpZ91QCEcvewVphNUtgQX7xrp5QP0oFo6DgM=";
|
||||
flutter_chat_ui = "sha256-4fuag7lRH5cMBFD3fUzj2K541JwXLoz8HF/4OMr3uhk=";
|
||||
flutter_link_previewer = "sha256-4fuag7lRH5cMBFD3fUzj2K541JwXLoz8HF/4OMr3uhk=";
|
||||
};
|
||||
|
||||
meta = {
|
||||
description = "A simple and user-friendly Matrix client";
|
||||
mainProgram = "nexus";
|
||||
platforms = lib.platforms.linux;
|
||||
maintainers = with lib.maintainers; [ quadradical ];
|
||||
};
|
||||
}
|
||||
|
|
@ -1,19 +0,0 @@
|
|||
{
|
||||
androidenv,
|
||||
}:
|
||||
androidenv.composeAndroidPackages {
|
||||
toolsVersion = "26.1.1";
|
||||
platformToolsVersion = "36.0.1";
|
||||
buildToolsVersions = [
|
||||
"35.0.0"
|
||||
"36.0.0"
|
||||
];
|
||||
cmakeVersions = [ "3.22.1" ];
|
||||
platformVersions = [ "36" ];
|
||||
abiVersions = [
|
||||
"armeabi-v7a"
|
||||
"arm64-v8a"
|
||||
];
|
||||
includeNDK = true;
|
||||
ndkVersions = [ "28.2.13676358" ];
|
||||
}
|
||||
|
|
@ -1,9 +0,0 @@
|
|||
#!/usr/bin/env bash
|
||||
pushd "$(dirname "$(readlink -f "$0")")"/.. > /dev/null || exit
|
||||
|
||||
mkdir -p build
|
||||
touch build/lock
|
||||
dart scripts/generate.dart
|
||||
rm build/lock
|
||||
|
||||
popd > /dev/null || exit
|
||||
Loading…
Add table
Add a link
Reference in a new issue