anandnet / Harmony-Music

A cross platform App for streaming Music
GNU General Public License v3.0
974 stars 74 forks source link

Commit the `pubspec.lock` file #274

Closed Libadoxon closed 2 months ago

Libadoxon commented 2 months ago

Is your feature request related to a problem or new idea? Please describe. I'm currently trying to package Harmony-Music for NixOs. This requires the pubspec.lock for fetching the dependencies. This is also the recommended approach by dart

Describe the solution you'd like Remove /pubspec.lock from .gitignore, rebuild and commit.

Describe alternatives you've considered I could also use the .deb file from the releases. This is the more disliked approach as it removes a lot of the flexibility that nix allows for.

anandnet commented 2 months ago

@Libadoxon Included pubspec.lock.

Libadoxon commented 2 months ago

Thanks

quazar-omega commented 3 weeks ago

@Libadoxon hi! I'm curious about the Nix packaging, did you manage to get it working?

Libadoxon commented 3 weeks ago

Sadly I haven't mange to package harmony for nix. I have no idea of Dart/Flutter so I might be missing something, but currently some dependency (I think) wants to compile a c(++) project and tries to download additional dependencies for it during the buildPhase, which nix doesn't allow for.

Logs ``` ... [ +73 ms] Building Linux application... [ +10 ms] executing: [build/linux/x64/release/] cmake -G Ninja -DCMAKE_BUILD_TYPE=Release -DFLUTTER_TARGET_PLATFORM=linux-x64 /build/source/linux [ +462 ms] -- The CXX compiler identification is Clang 18.1.8 [ +84 ms] -- Detecting CXX compiler ABI info [ +354 ms] -- Detecting CXX compiler ABI info - done [ +87 ms] -- Check for working CXX compiler: /nix/store/qb1x0mipbcvnkr40xwiwp24gg8lffrc0-clang-wrapper-18.1.8/bin/clang++ - skipped [ ] -- Detecting CXX compile features [ +1 ms] -- Detecting CXX compile features - done [ +15 ms] -- Found PkgConfig: /nix/store/mi7q9m86m3rkqmc0niyvfv25ji9fxxha-pkg-config-wrapper-0.29.2/bin/pkg-config (found version "0.29.2") [ +1 ms] -- Checking for module 'gtk+-3.0' [ +60 ms] -- Found gtk+-3.0, version 3.24.43 [ +411 ms] -- Checking for module 'glib-2.0' [ +48 ms] -- Found glib-2.0, version 2.80.4 [ +94 ms] -- Checking for module 'gio-2.0' [ +36 ms] -- Found gio-2.0, version 2.80.4 [ +154 ms] CMake Error at flutter/ephemeral/.plugin_symlinks/audiotags/linux/CMakeLists.txt:45 (file): [ +2 ms] file DOWNLOAD cannot open file for write. [ +6 ms] CMake Error: Problem with archive_read_open_file(): Failed to open 'linux.tar.gz' [ ] CMake Error: Problem extracting tar: linux.tar.gz [ +15 ms] -- Checking for module 'ayatana-appindicator3-0.1' [ +61 ms] -- Found ayatana-appindicator3-0.1, version 0.5.92 [ +440 ms] -- Configuring incomplete, errors occurred! [ +22 ms] Building Linux application... (completed in 2,364ms) [ ] "flutter linux" took 3,086ms. [ +3 ms] Unable to generate build files [ ] #0 throwToolExit (package:flutter_tools/src/base/common.dart:10:3) #1 _runCmake (package:flutter_tools/src/linux/build_linux.dart:174:5) #2 buildLinux (package:flutter_tools/src/linux/build_linux.dart:81:5) #3 BuildLinuxCommand.runCommand (package:flutter_tools/src/commands/build_linux.dart:87:5) #4 FlutterCommand.run. (package:flutter_tools/src/runner/flutter_command.dart:1408:27) #5 AppContext.run. (package:flutter_tools/src/base/context.dart:153:19) #6 CommandRunner.runCommand (package:args/command_runner.dart:212:13) #7 FlutterCommandRunner.runCommand. (package:flutter_tools/src/runner/flutter_command_runner.dart:416:9) #8 AppContext.run. (package:flutter_tools/src/base/context.dart:153:19) #9 FlutterCommandRunner.runCommand (package:flutter_tools/src/runner/flutter_command_runner.dart:364:5) #10 run.. (package:flutter_tools/runner.dart:130:9) #11 AppContext.run. (package:flutter_tools/src/base/context.dart:153:19) #12 main (package:flutter_tools/executable.dart:93:3) [ +1 ms] Running 1 shutdown hook [ ] Shutdown hooks complete [ +4 ms] exiting with code 1 ```

One could maybe prefetch these files but no idea. I'm currently very low on time so I won't be working on it any time soon. If you're interested in fixing things yourself, or anyone else, here's my current nix build file:

Build File ```nix { fetchFromGitHub, flutter, stdenv, yj, libayatana-appindicator, gnomeExtensions, lib, }: flutter.buildFlutterApplication rec { pname = "harmony-music"; version = "1.10.2"; src = fetchFromGitHub { owner = "anandnet"; repo = "Harmony-Music"; rev = "e7c458a922d04d20721bc043639e7c865aedfaa9"; hash = "sha256-D28g9W2dNAj2aeZnduJa0Qye+7qvwIZZjM7PNWG6Poo="; fetchSubmodules = true; }; buildInputs = [ libayatana-appindicator gnomeExtensions.appindicator ]; pubspecLock = let pubspecLockFile = stdenv.mkDerivation { name = "pubspec-lock-file"; inherit version src; nativeBuildInputs = [ yj ]; buildPhase = '' cat ./pubspec.lock | yj > $out ''; dontInstall = true; dontFixup = true; }; in lib.importJSON pubspecLockFile; gitHashes = { "device_equalizer" = "sha256-fvS611D/0U5yJC5i88JdyVNhJozt8tXPhgkkvHgIDRo="; "sdk_int" = "sha256-ABlghY7RE/E/1G7xP10LuVSWPxbg4jyfLon8XMv8rYo="; "just_audio_media_kit" = "sha256-cNuKwOAEcFCTfbKhvBvYAdmD5qFeNW16jc3A+6ID3bM="; "sidebar_with_animation" = "sha256-Y7dTO4wN7cOmm2mnzQPW/gDYltLr7wMKMXbGtAg8WzY="; "player_response" = "sha256-N8aMFhQQslIohKAMSKVe2lDeXsJtM9PQrFhaltuUNMo="; }; } ```
quazar-omega commented 3 weeks ago

Thank you! I don't have any experience packaging personally, so I don't think I'll be able to help, hopefully somebody else more experienced comes around, I think this will prove useful