Skip to content

Build failure: ytmdesktop #298748

Closed
Closed

Description

@LennyLizowzskiy

Project's repository no longer exist.

https://github.com/ytmdesktop/ytmdesktop

Notify maintainers

@lgcl
@khaneliman (last person to edit the derivation's definition)


Add a 👍 reaction to issues you find important.

Activity

  1. Alipoodle commented on May 7, 2024

    @Alipoodle

    Hi.
    Is it possible to reverse this now that the Organisation is back? 😁

    Am looking also into updating to our latest v2.0.5 version as well and ideally automating the process as much as possible so a release will automatically push to here.

  2. LogicalOverflow commented on May 7, 2024

    @LogicalOverflow
    Contributor

    (I was the package maintainer, before it was deleted, but I personally haven't used ytmdesktop for quite some time now, because v1 had some known issues on my setup. I would like to switch back to it with v2 being out, tho)

    I think we could revert the commit, but it probably makes more sense to just create a new package with the v2 version. Also, if we do re-add v1, we probably need to mark it as insecure as it has some EOL dependencies iirc.

    I tried packaging v2 some time ago, but didn't get anywhere due to my lack of js/electron experience. The workaround I used for v1, just re-packaging the appimage, is no longer possible, as you stop releasing appimages. If there is an appimage release of v2, I could probably create a simple v2 package and then also maintain that. Though, I don't know how much effort maintaining an additional release format upstream is for you. Sadly, I currently don't have the time to figure out how to package ytmdesktop from source, but maybe someone else is willing and able to do that.

    Adding (mostly) automatic updates, once we have a working v2 packages, shouldn't be hard with nixpkgs-update and the related infrastructure in nixpkgs. (Though, I personally have no experience with that yet.)

  3. Alipoodle commented on May 9, 2024

    @Alipoodle

    Thank you for the work in helping maintain the package ❤️
    and Thanks for the info regarding packaging.
    With the usage of Electron Forge instead of Electron Builder, we've also changed how packaging works.

    Stuff like: Flatpak and Snap editions exist, but sadly how Linux packages are existing builders which exist.
    (electron-forge-maker-appimage)[https://www.npmjs.com/package/electron-forge-maker-appimage?activeTab=dependents] suggests there is also an App image builder 🤷 but it apperas to just be a basic proxy to Electron builder~

    Otherwise building Linux Applications is a whole new thing for me, and given we've basically reset the entire codebase to fix a number of underlying issues, there's likely lots of bits which still need poking at again which didn't exist before.

  4. cjshearer commented on Jun 5, 2024

    @cjshearer
    Member

    I opened a PR for re-initializing ytmdesktop: #317309

    Also, while I managed to get ytmdesktop to build from source using nix develop, whenever I used nix build I would get some strange TLS cert errors, despite passing the NODE_EXTRA_CA_CERTS flag. In the end, I gave up on building it from source, since I realized that with a small patch to the source code I could just extract the assets from any of the releases and reuse them everywhere (it's all just JS and bitmaps 🤷‍♂️).

    For anyone who cares about building it from source and investigating that TLS error, here is where I left off with that
    { lib
    , cacert
    , electron_29
    , fetchFromGitHub
    , git
    , libsecret
    , makeWrapper
    , nodejs_20
    , stdenvNoCC
    , yarn-berry
    }:
    stdenvNoCC.mkDerivation (finalAttrs: {
      pname = "ytmdesktop";
      version = "2.0.5";
      meta = {
        description = "A Desktop App for YouTube Music";
        homepage = "https://ytmdesktop.app/";
        license = lib.licenses.gpl3Only;
        maintainers = [ lib.maintainers.cjshearer ];
        platforms = lib.platforms.all;
        mainProgram = finalAttrs.pname;
      };
    
      src = fetchFromGitHub {
        owner = finalAttrs.pname;
        repo = finalAttrs.pname;
        rev = "v${finalAttrs.version}";
        hash = "sha256-Wmc7PbLdmLayIb5wbJNn7+MuMY7dEeidLCeyjUoL26I=";
        leaveDotGit = true; # ytmdesktop sources the commit hash during a build by calling `git ...` 
      };
    
      nativeBuildInputs = [
        electron_29
        makeWrapper
      ];
    
      appAsar = stdenvNoCC.mkDerivation {
        inherit (finalAttrs) src;
        name = "${finalAttrs.pname}-${finalAttrs.version}-deps";
    
        nativeBuildInputs = [ yarn-berry git nodejs_20 ];
    
        patchPhase = ''
          # we'll use whatever version yarn-berry has
          sed -i '/,\npackageManager/d' package.json
    
          # https://github.com/electron/electron/issues/31121
          substituteInPlace src/main/index.ts \
            --replace-fail "process.resourcesPath" "'$out/share/${finalAttrs.pname}/resources'"  
        '';
    
        configurePhase =
          let
            supportedArchitectures = builtins.toJSON {
              os = [ "darwin" "linux" ];
              cpu = [ "arm" "arm64" "ia32" "x64" ];
              libc = [ "glibc" "musl" ];
            };
          in
          ''
            export ELECTRON_SKIP_BINARY_DOWNLOAD="1"
            export HOME="$NIX_BUILD_TOP"
            export NODE_EXTRA_CA_CERTS="${cacert}/etc/ssl/certs/ca-bundle.crt"
            yarn config set enableGlobalCache false
            yarn config set enableInlineBuilds true
            yarn config set enableProgressBars true
            yarn config set enableTelemetry false
            yarn config set supportedArchitectures --json '${supportedArchitectures}'
            yarn config set cacheFolder $out
          '';
    
        buildPhase = ''
          yarn install --immutable --mode=skip-build
          yarn electron-forge package
        '';
    
        installPhase = ''
          cp -r out/*/{locales,resources{,.pak}} $out/share/${finalAttrs.pname}
        '';
    
        outputHashAlgo = "sha256";
        outputHash = "sha256-QbXeT+qsKhPAHTdACwAeg2HcWk49/xGEDBXun1tXGZq=";
        outputHashMode = "recursive";
      };
    
      configurePhase = ''
        runHook preConfigure
    
        yarn config set enableOfflineMode true
        yarn config set cacheFolder ${finalAttrs.yarnOfflineCache}
      '';
    
      buildPhase = ''
        yarn install --immutable --immutable-cache --mode=skip-build
        yarn electron-forge package
      '';
    
      installPhase = ''
        mkdir -p $out/share/${finalAttrs.pname}
        cp -r out/*/{locales,resources{,.pak}} $out/share/${finalAttrs.pname}
    
        makeWrapper '${lib.getExe electron_29}' $out/bin/${finalAttrs.pname} \
          --add-flags $out/share/${finalAttrs.pname}/resources/app.asar \
          --add-flags "\''${NIXOS_OZONE_WL:+\''${WAYLAND_DISPLAY:+--ozone-platform-hint=auto --enable-features=WaylandWindowDecorations}}" \
          --set-default ELECTRON_IS_DEV 0 \
          --inherit-argv0 
      '';
    })
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    0.kind: build failure

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions