├── export.sh ├── README.md ├── joplin-deb.sh ├── LICENSE └── Dockerfile /export.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # export DEB file 4 | 5 | # Get owner id of Downloads 6 | OWNER=$(stat -c '%u' /usr/src/Downloads) 7 | printf "Downloads owner is $OWNER\n" 8 | 9 | # Copy package to Downloads and update file owner 10 | find / -name Downloads 11 | mv /usr/src/joplin/packages/app-desktop/dist/Joplin-${VERSION}.deb /usr/src/Downloads/joplin_${VERSION}_amd64.deb 12 | chown $OWNER:$OWNER Downloads/joplin_${VERSION}_amd64.deb 13 | 14 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | This script will download the [Joplin](https://joplinapp.org/desktop) source and package it into a DEB file. 2 | The DEB file should be installable on relatively modern Debian/Ubuntu like OS'. 3 | Tested on Debian 11, your mileage may vary. 4 | 5 | Requirements: 6 | 7 | Docker installed 8 | ``` 9 | apt-get install docker.io 10 | sudo gpasswd -a $USER docker 11 | ``` 12 | Usage: 13 | 14 | ./joplin-deb.sh joplin-version 15 | 16 | Example: 17 | ``` 18 | ./joplin-deb.sh 2.5.12 19 | ``` 20 | If the build is successful, it will create a DEB file in the current user's Downloads folder. 21 | 22 | Install it with: 23 | ``` 24 | sudo apt install ~/Downloads/joplin-desktop_*.deb 25 | ``` 26 | 27 | -------------------------------------------------------------------------------- /joplin-deb.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -e 4 | if [ $# -eq 0 ]; then 5 | printf "Usage: joplin-deb.sh version\nExample: ./joplin-deb.sh 2.5.12\n" 6 | exit 1 7 | fi 8 | 9 | box_out() 10 | { 11 | local s=("$@") b w 12 | for l in "${s[@]}"; do 13 | ((w<${#l})) && { b="$l"; w="${#l}"; } 14 | done 15 | tput setaf 3 16 | echo " -${b//?/-}- 17 | | ${b//?/ } |" 18 | for l in "${s[@]}"; do 19 | printf '| %s%*s%s |\n' "$(tput setaf 4)" "-$w" "$l" "$(tput setaf 3)" 20 | done 21 | echo "| ${b//?/ } | 22 | -${b//?/-}-" 23 | tput sgr 0 24 | } 25 | 26 | docker build . --build-arg VERSION=$1 -t joplin-deb 27 | docker run \ 28 | --rm \ 29 | --name joplin-deb \ 30 | -v ${HOME}/Downloads:/usr/src/Downloads \ 31 | joplin-deb /bin/bash -c "VERSION=$1 export.sh" 32 | 33 | box_out "Build complete!" \ 34 | "Joplin deb package saved to ${HOME}/Downloads/joplin_$1_amd64.deb" \ 35 | "Install with:" \ 36 | "sudo dpkg -i ~/Downloads/joplin_$1_amd64.deb" \ 37 | "Or with your package manager of choice" 38 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2021 CVan 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM node:lts-trixie-slim 2 | 3 | ARG VERSION 4 | 5 | WORKDIR /usr/src 6 | 7 | RUN set -ex \ 8 | # Install Joplin build dependencies 9 | && apt-get update \ 10 | && apt-get upgrade -yq \ 11 | && apt-get install -yq \ 12 | git \ 13 | make \ 14 | g++ \ 15 | fakeroot \ 16 | pkg-config \ 17 | libsecret-1-dev \ 18 | libvips-dev \ 19 | rsync \ 20 | curl \ 21 | && curl -fsSL -o joplin.tar.gz \ 22 | https://github.com/laurent22/joplin/archive/refs/tags/v"${VERSION}".tar.gz 23 | 24 | ENV SHARP_IGNORE_GLOBAL_LIBVIPS=1 25 | 26 | RUN set -ex \ 27 | # Compile Joplin 28 | && mkdir joplin \ 29 | && tar -xzf joplin.tar.gz -C joplin/ --strip-components=1 \ 30 | && rm joplin.tar.gz \ 31 | && cd joplin \ 32 | # Workaround for socket timeout errors with lerna 33 | && sed -i '0,/--no-ci/s//--no-ci --concurrency=2/' package.json \ 34 | # Remove some things we don't need to build 35 | && sed -i '/"releaseAndroid"/d; \ 36 | /"releaseAndroidClean"/d; \ 37 | /"releaseCli"/d; \ 38 | /"releaseClipper"/d; \ 39 | /"releaseIOS"/d; \ 40 | /"releasePluginGenerator"/d; \ 41 | /"releasePluginRepoCli"/d; \ 42 | /"releaseServer"/d; \ 43 | /"releaseTranscribe"/d' package.json \ 44 | # Build Joplin normally \ 45 | && rm -rf node_modules \ 46 | && yarn install --immutable \ 47 | && cd packages/app-desktop \ 48 | && yarn run dist 49 | 50 | ADD export.sh /usr/local/bin 51 | 52 | --------------------------------------------------------------------------------