Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 3 additions & 19 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 2 additions & 4 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@

inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
nix-filter.url = "github:numtide/nix-filter";
libnbtplusplus = {
url = "github:FreesmTeam/libnbtplusplus";
flake = false;
Expand All @@ -26,7 +25,6 @@
outputs = {
self,
nixpkgs,
nix-filter,
libnbtplusplus,
...
}: let
Expand All @@ -41,7 +39,7 @@
in {
overlays.default = final: prev: {
freesmlauncher-unwrapped = final.callPackage ./nix/unwrapped.nix {
inherit nix-filter libnbtplusplus self;
inherit libnbtplusplus self;
};

freesmlauncher = final.callPackage ./nix/wrapper.nix;
Expand All @@ -51,7 +49,7 @@
pkgs = import nixpkgs {inherit system;};

freesmlauncher-unwrapped = pkgs.callPackage ./nix/unwrapped.nix {
inherit nix-filter libnbtplusplus self;
inherit libnbtplusplus self;
};

freesmlauncher = pkgs.callPackage ./nix/wrapper.nix {
Expand Down
4 changes: 4 additions & 0 deletions garnix.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
builds:
exclude: []
include:
- "packages.*.freesmlauncher"
154 changes: 73 additions & 81 deletions nix/unwrapped.nix
Original file line number Diff line number Diff line change
Expand Up @@ -14,96 +14,88 @@
tomlplusplus,
ghc_filesystem,
libarchive,
darwin,
gamemode,
extra-cmake-modules,
nix-filter,
pkg-config,
msaClientID ? null,
gamemodeSupport ? stdenv.hostPlatform.isLinux,
}: let
isDarwin = stdenv.hostPlatform.isDarwin;
in
assert lib.assertMsg (gamemodeSupport -> stdenv.hostPlatform.isLinux)
"gamemodeSupport only on linux";
stdenv.mkDerivation {
pname = "freesmlauncher-unwrapped";
version = self.shortRev or self.dirtyShortRev or "_git";
src = nix-filter.lib {
root = self;
include = [
"buildconfig"
"cmake"
"launcher"
"libraries"
"program_info"
"tests"
../docs/COPYING.md
../CMakeLists.txt
];
}:
assert lib.assertMsg (gamemodeSupport -> stdenv.hostPlatform.isLinux)
"gamemodeSupport only on linux";
stdenv.mkDerivation {
pname = "freesmlauncher-unwrapped";
version = self.shortRev or self.dirtyShortRev or "_git";
src = with lib.fileset;
toSource {
root = ../.;
fileset = unions [
../buildconfig
../cmake
../launcher
../libraries
../program_info
../tests

# Some fetchers leave submodules directories empty instead of omitting them, causing Garnix CI cache misses.
exclude = [
"libraries/libnbtplusplus"
../CMakeLists.txt
../docs/COPYING.md
];
};

postUnpack = ''
ln -s ${libnbtplusplus} source/libraries/libnbtplusplus
'';
postUnpack = let
folder = "source/libraries/libnbtplusplus";
in ''
rm -rf ${folder}
ln -s ${libnbtplusplus} ${folder}
'';

nativeBuildInputs = [
cmake
ninja
extra-cmake-modules
jdk17
stripJavaArchivesHook
];
nativeBuildInputs = [
cmake
ninja
kdePackages.extra-cmake-modules
jdk17
stripJavaArchivesHook
pkg-config
];

buildInputs =
[
cmark
ghc_filesystem
kdePackages.qtbase
kdePackages.qtnetworkauth
kdePackages.quazip
libarchive
tomlplusplus
qrencode
zlib
]
++ lib.optionals isDarwin [darwin.apple_sdk.frameworks.Cocoa]
++ lib.optionals gamemodeSupport [gamemode];
buildInputs =
[
cmark
ghc_filesystem
kdePackages.qtbase
kdePackages.qtnetworkauth
kdePackages.quazip
libarchive
tomlplusplus
qrencode
zlib
]
++ lib.optionals gamemodeSupport [gamemode];

cmakeFlags =
[(lib.cmakeFeature "Launcher_BUILD_PLATFORM" "nixpkgs")]
++ lib.optionals (msaClientID != null) [
(lib.cmakeFeature "Launcher_MSA_CLIENT_ID" msaClientID)
]
++ lib.optionals (lib.versionOlder kdePackages.qtbase.version "6")
[
(lib.cmakeFeature "Launcher_QT_VERSION_MAJOR" "5")
]
++ lib.optionals stdenv.hostPlatform.isDarwin [
(lib.cmakeFeature "INSTALL_BUNDLE" "nodeps")
(lib.cmakeFeature "MACOSX_SPARKLE_UPDATE_FEED_URL" "''")
(lib.cmakeFeature "CMAKE_INSTALL_PREFIX" "${placeholder "out"}/Applications/")
];
cmakeFlags =
[(lib.cmakeFeature "Launcher_BUILD_PLATFORM" "nixpkgs")]
++ lib.optionals (msaClientID != null) [
(lib.cmakeFeature "Launcher_MSA_CLIENT_ID" msaClientID)
]
++ lib.optionals stdenv.hostPlatform.isDarwin [
(lib.cmakeFeature "INSTALL_BUNDLE" "nodeps")
(lib.cmakeFeature "MACOSX_SPARKLE_UPDATE_FEED_URL" "''")
(lib.cmakeFeature "CMAKE_INSTALL_PREFIX" "${placeholder "out"}/Applications/")
];

doCheck = true;
dontWrapQtApps = true;
enableParallelBuilding = true;
doCheck = stdenv.hostPlatform.isLinux;
dontWrapQtApps = true;
enableParallelBuilding = true;

meta = {
description = "Prism Launcher fork aimed to provide a free way to play Minecraft";
longDescription = ''
Freesm Launcher is a custom launcher for Minecraft that allows you
to easily manage multiple installations of Minecraft at once and login
with offline account without any restrictions.
'';
homepage = "https://freesmlauncher.org/";
license = lib.licenses.gpl3Only;
platforms = lib.platforms.linux ++ lib.platforms.darwin;
mainProgram = "freesmlauncher";
maintainers = with lib.maintainers; [s0me1newithhand7s];
};
}
meta = {
description = "Prism Launcher fork aimed to provide a free way to play Minecraft";
longDescription = ''
Freesm Launcher is a custom launcher for Minecraft that allows you
to easily manage multiple installations of Minecraft at once and login
with offline account without any restrictions.
'';
homepage = "https://freesmlauncher.org/";
license = lib.licenses.gpl3Only;
platforms = lib.platforms.linux ++ lib.platforms.darwin;
mainProgram = "freesmlauncher";
maintainers = with lib.maintainers; [s0me1newithhand7s];
};
}
15 changes: 10 additions & 5 deletions nix/wrapper.nix
Original file line number Diff line number Diff line change
Expand Up @@ -85,17 +85,22 @@ in
paths = [launcher];
nativeBuildInputs = [kdePackages.wrapQtAppsHook];
buildInputs = with kdePackages;
[qtbase qtsvg]
[qtbase qtsvg qtimageformats]
++ lib.optional (lib.versionAtLeast qtbase.version "6" && isLinux) qtwayland;

postBuild = ''
wrapQtAppsHook
'';

qtWrapperArgs =
["--prefix FREESMLAUNCHER_JAVA_PATHS : ${lib.makeSearchPath "bin/java" jdks}"]
++ lib.optionals isLinux [
"--prefix PATH : ${lib.makeBinPath runtimePrograms}"
"--prefix LD_LIBRARY_PATH : ${addDriverRunpath.driverLink}/lib:${lib.makeLibraryPath runtimeLibs}"
];

postInstall = lib.optionalString stdenv.hostPlatform.isDarwin ''
if [ -d "$out/Applications/FreesmLauncher.app/Contents/MacOS" ]; then
mkdir -p "$out/bin"
ln -s \
"$out/Applications/FreesmLauncher.app/Contents/MacOS/freesmlauncher" \
"$out/bin/freesmlauncher"
fi
'';
}
Loading