{"id":20652093,"url":"https://github.com/elixir-desktop/deployment","last_synced_at":"2025-04-18T12:28:38.978Z","repository":{"id":66253186,"uuid":"429809332","full_name":"elixir-desktop/deployment","owner":"elixir-desktop","description":"Still raw repo with deployment scripts","archived":false,"fork":false,"pushed_at":"2025-02-27T20:55:47.000Z","size":948,"stargazers_count":6,"open_issues_count":5,"forks_count":5,"subscribers_count":6,"default_branch":"main","last_synced_at":"2025-03-29T06:22:15.318Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/elixir-desktop.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-11-19T13:34:48.000Z","updated_at":"2025-03-26T00:26:46.000Z","dependencies_parsed_at":null,"dependency_job_id":"5ba00de1-e04a-48bb-8f41-653361a7d458","html_url":"https://github.com/elixir-desktop/deployment","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elixir-desktop%2Fdeployment","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elixir-desktop%2Fdeployment/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elixir-desktop%2Fdeployment/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elixir-desktop%2Fdeployment/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/elixir-desktop","download_url":"https://codeload.github.com/elixir-desktop/deployment/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249493224,"owners_count":21281502,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-16T17:32:21.098Z","updated_at":"2025-04-18T12:28:38.971Z","avatar_url":"https://github.com/elixir-desktop.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Generating Installers\n\nThese mix tasks generate binary installers for your Elixir-Desktop project in corresponding native formats. Currently supported output formats are:\n\n* Windows: `.exe` installer (NSIS based)\n* MacOS: `.dmg` download package\n* Linux: `.run` makeself installer.\n\n## Usage\n\n1. Add a new release to your project configuration that includes the `\u0026Desktop.Deployment.generate_installer/1` steps\n2. Add the `package: package()` configuration with your app packaging information. If you don't provide these, default values will be used.\n3. Run `mix desktop.installer` to generate the installer for your current OS\n\n```elixir\n  def project do\n    [\n      package: package(),\n      releases: [\n        default: [\n          applications: [runtime_tools: :permanent, ssl: :permanent],\n          steps: [:assemble, \u0026Desktop.Deployment.generate_installer/1]\n        ],\n      ],\n    ]\n  end\n\n  def package() do\n    [\n      name: \"MyApp\",\n      name_long: \"The most wonderfull App Ever\",\n      description: \"MyApp is an Elixir App for Desktop\",\n      description_long: \"MyApp for Desktop is powered by Phoenix LiveView\",\n      icon: \"priv/icon.png\",\n      # https://developer.gnome.org/menu-spec/#additional-category-registry\n      category_gnome: \"GNOME;GTK;Office;\",\n      category_macos: \"public.app-category.productivity\",\n      identifier: \"io.myapp.app\",\n    ]\n  end  \n```\n\n## Installation\n\nThe the package can be installed\nby adding `desktop_deployment` to your list of dependencies in `mix.exs`:\n\n```elixir\ndef deps do\n  [\n    {:desktop_deployment, \"~\u003e 0.1\", runtimes: false}\n  ]\nend\n```\n\n## Deployment Strategies\n\n### Windows -\u003e NSIS\n\nAll builds (specifically NIFs) are built using msys2, because it's mostly linux compatible but runs natively on windows without any helper libraries. \n\n0) Installing prerequsites\n  - msys2.org\n  - `pacman -S mingw-w64-x86_64-imagemagick mingw-w64-x86_64-nsis mingw-w64-x86_64-nsis mingw-w64-x86_64-osslsigncode mingw-w64-x86_64-openssl`\n\n1) `mix deployment` will generate the release binaries\n\nTo support windows code signing the user has to create two certificate files `app_key.pem` and `app_key.pem` (e.g. get from sectigo) and put them into the `rel/win32/` subdirectory. \n\n#### Known Issues / Comments\n\n* The `.vbs` file is used as indirection for the `.bat` file as it avoid creating a black terminal screen that otherwise flashes shortly when launchin a `.bat` file directly\n\n* The `.nsis` file currently registers a `app://` protocol handler, this is example use and can be removed for other apps.\n\n* After having done static builds for iOS now we're thinking a pure `.exe` build for Windows might actually be a much cleaner solution. But TBD\n\n### MacOS -\u003e DMG\n\nThe builds are all done on an x86_64 apple machine and we're enabling rosetta explicitly in the `.plist` file for M1 machines.\n\nTo run either you will need a macos development account. There are two environment variables this depends on `DEVELOPER_ID` which is set by `build_macos.sh` automatically using the default. `AC_PASSWORD` which is the API key for your account\n\n1) `build_macos.sh`\n2) `notarize_macos.sh`\n\n#### Known Issues / Comments\n\n* Background images for the deployment window of the `.dmg` (when clicking that on macos) are hardcoded in the rel/macosx/ subdirectory. I've not yet discovered how to properly (dynamically) create them. Also haven't found out how to set the DMGs icon to be non-standard as some apps do.\n\n* The DMG should be notarized in two phases but right now it's not :-(\n\n    1) Notarize the app directory (by zipping and uploading it)\n    1) Staple the ticket to the app directory and all executables\n    1) Package the app directory into the dmg, notarize the dmg\n    1) Staple the ticket to the dmg\n\n* Best to use a really recent wxWidgets on macos, such as wxWidgets (3.1.6) as e.g. taskbar icon size bug fixes are only present there.\n\n### Linux -\u003e makeself\n\n#### Known Issues / Comments\n\n* wxWidgets notifications+taskbar support is really varying accross distributions. Currently we have a pure Elixir dbus implementation.\n\n* Getting distribution independent linux binaries is really though. Main issues have been library dependencies of different versions. Future thoughts for this:\n    * Switch to AppImage\n    * Switch to deb packages\n    * other?\n\n# Build dependencies\n\n## Building on Ubuntu Linux\n\n**Install Dependencies and Tools:**\n```\n# Tools\nsudo apt install curl git inotify-tools libtool automake make lksctp-tools build-essential\n# Build dependencies\nsudo apt install libssl-dev libjpeg-dev libpng-dev libtiff-dev zlib1g-dev libncurses5-dev libssh-dev unixodbc-dev libgmp3-dev libwebkit2gtk-4.0-dev libsctp-dev libgtk-3-dev libnotify-dev libsecret-1-dev catch mesa-common-dev libglu1-mesa-dev freeglut3-dev\n```\n\n**Install wxWidgets 3.1.5:**\n```\nmkdir ~/projects \u0026\u0026 cd ~/projects\ngit clone https://github.com/dominicletz/wxWidgets.git\ncd wxWidgets\ngit submodule update --init\n./configure --enable-compat30\nmake -j4\n```\n\n**Install Erlang OTP24:**\n```\ncurl -O https://raw.githubusercontent.com/kerl/kerl/master/kerl\nchmod a+x kerl\nsudo mv kerl /usr/bin/\nexport LD_LIBRARY_PATH=$HOME/projects/wxWidgets/lib\nexport KERL_CONFIGURE_OPTIONS=--with-wxdir=$HOME/projects/wxWidgets\nkerl build git https://github.com/diodechain/otp.git diode/beta 24.beta\nkerl install 24.beta ~/24.beta\n. ~/24.beta/activate\n```\n\n**Install Elixir:**\n```\nmkdir $HOME/elixir \u0026\u0026 cd $HOME/elixir\nwget https://github.com/elixir-lang/elixir/releases/download/v1.11.4/Precompiled.zip\nunzip Precompiled.zip\necho \"export PATH=\\\"$HOME/elixir/bin:\\$PATH\\\"\" \u003e\u003e ~/.bashrc\nexport PATH=\"$HOME/elixir/bin:$PATH\"\n```\n\n**Install NodeJS:**\n\n```\ncurl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.37.2/install.sh | bash\nnvm install v12.16.1\n```\n*Note: If you get \"nvm: command not found\" after running \"nvm install v12.16.1\" in the terminal, try closing the current teminal, opening a new one, and then running \"nvm install v12.16.1\" again. (see https://github.com/nvm-sh/nvm/blob/master/README.md#troubleshooting-on-linux for more information).*\n\n## Building on macOS\n\n**Start with the dependencies:**\n\n```\nbrew install binutils automake elixir kerl libtool gmp\nexport PATH=/usr/local/opt/binutils/bin:$PATH\n```\n\nWxWidgets with recent macOS fixes\n\n```\nmkdir -p ~/projects/\ncd ~/projects/\ngit clone https://github.com/dominicletz/wxWidgets.git\ncd wxWidgets\ngit submodule update --init\n./configure --enable-compat30\nmake -j4\n```\n\n**Build with kerl**\n\n```\nkerl build git https://github.com/diodechain/otp.git diode/beta 24.beta\nkerl install 24.beta ~/24.beta\n. ~/24.beta/activate\n```\n\n**Install nodejs / npm 12.16.1**\n\n```\nbrew install npm\nnvm install v12.16.1\ncd assets \u0026\u0026 npm install \u0026\u0026 cd ..\n```\n\n**Compile and run:**\n\n```\nmix local.hex --force\nmix local.rebar --force\nmix deps.get\n\n. ~/24.beta/activate\n./run\n```\n\n## Building on Windows\n**Install Dependencies:**\n\nGet Erlang 24:diode/beta http://github.com/diodechain/\n\nGet Elixir 1.11.4 https://elixir-lang.org/install.html\n\nGet msys2 https://www.msys2.org/ - And a whole bunch of deps:\npacman -Syu\npacman -S --noconfirm pacman-mirrors pkg-config\npacman -S --noconfirm --needed base-devel autoconf automake make libtool mingw-w64-x86_64-toolchain mingw-w64-x86_64-openssl mingw-w64-x86_64-libtool git\n\nGet nsis https://nsis.sourceforge.io/Main_Page\n\nGet npm \u0026 node 12.x from https://nodejs.org/dist/latest-v12.x/\n\nIf not merged yet apply this patch on esqlite:\nhttps://github.com/blt/port_compiler/pull/69/files\n\n    \u003e vim `find -iname pc_port_specs.erl`\n    \u003e find -iname pc_port_specs.beam -delete\n\nSometimes libsecp256k_nif.dll is not created in that case copy the libsecp256k_nif.so to libsecp256k_nif.dll \u003e make -C deps/\n\n**Compile \u0026 Run:**\n\nKeep pressing ENTER during the compilation or it gets stuck...\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felixir-desktop%2Fdeployment","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Felixir-desktop%2Fdeployment","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felixir-desktop%2Fdeployment/lists"}