Unverified Commit 0eebac9b authored by Sandro Jäckel's avatar Sandro Jäckel Committed by GitHub
Browse files

zotero: 7.0.30 -> 8.0.2, build from source (#483099)

parents c5599449 fbbca38d
Loading
Loading
Loading
Loading
+55 −0
Original line number Diff line number Diff line
diff --git a/app/scripts/dir_build b/app/scripts/dir_build
index 493288ad47..ccabb3722b 100755
--- a/app/scripts/dir_build
+++ b/app/scripts/dir_build
@@ -86,7 +86,7 @@ fi
 
 CHANNEL="source"
 
-hash=$(git -C "$ROOT_DIR" rev-parse --short HEAD)
+hash="0000000000000000000000000000000000000000"
 
 build_dir=$(mktemp -d)
 cleanup() { rm -rf "$build_dir"; }
diff --git a/js-build/note-editor.js b/js-build/note-editor.js
index 1435730342..6eebb10c50 100644
--- a/js-build/note-editor.js
+++ b/js-build/note-editor.js
@@ -12,8 +12,7 @@ async function getZoteroNoteEditor(signatures) {
 
 	const modulePath = path.join(__dirname, '..', 'note-editor');
 
-	const { stdout } = await exec('git rev-parse HEAD', { cwd: modulePath });
-	const hash = stdout.trim();
+	const hash = '';
 
 	if (!('note-editor' in signatures) || signatures['note-editor'].hash !== hash) {
 		const targetDir = path.join(__dirname, '..', 'build', 'resource', 'note-editor');
diff --git a/js-build/pdf-worker.js b/js-build/pdf-worker.js
index b820304f3a..6bbd0708c9 100644
--- a/js-build/pdf-worker.js
+++ b/js-build/pdf-worker.js
@@ -12,8 +12,7 @@ async function getPDFWorker(signatures) {
 
 	const modulePath = path.join(__dirname, '..', 'pdf-worker');
 
-	const { stdout } = await exec('git rev-parse HEAD', { cwd: modulePath });
-	const hash = stdout.trim();
+	const hash = '';
 
 	if (!('pdf-worker' in signatures) || signatures['pdf-worker'].hash !== hash) {
 		const targetDir = path.join(__dirname, '..', 'build', 'chrome', 'content', 'zotero', 'xpcom', 'pdfWorker');
diff --git a/js-build/reader.js b/js-build/reader.js
index 67a02a3ad2..2127f680df 100644
--- a/js-build/reader.js
+++ b/js-build/reader.js
@@ -12,8 +12,7 @@ async function getReader(signatures) {
 
 	const modulePath = path.join(__dirname, '..', 'reader');
 	
-	const { stdout } = await exec('git rev-parse HEAD', { cwd: modulePath });
-	const hash = stdout.trim();
+	const hash = '';
 	
 	if (!('reader' in signatures) || signatures['reader'].hash !== hash) {
 		const targetDir = path.join(__dirname, '..', 'build', 'resource', 'reader');
+135 −0
Original line number Diff line number Diff line
diff --git a/app/scripts/fetch_xulrunner b/app/scripts/fetch_xulrunner
index 30c3a9073d..aa953744f8 100755
--- a/app/scripts/fetch_xulrunner
+++ b/app/scripts/fetch_xulrunner
@@ -148,15 +148,6 @@ function modify_omni {
 	# Continue using app.update.auto in prefs.js on Windows
 	replace_line 'PER_INSTALLATION_PREFS_PLATFORMS = \["win"\]' 'PER_INSTALLATION_PREFS_PLATFORMS = []' modules/UpdateUtils.sys.mjs
 	
-	# Prompt if major update is available instead of installing automatically on restart
-	replace_line 'if \(!updateAuto\) \{' 'if (update.type == "major") {
-      LOG("UpdateService:_selectAndInstallUpdate - prompting because it is a major update");
-      AUSTLMY.pingCheckCode(this._pingSuffix, AUSTLMY.CHK_SHOWPROMPT_PREF);
-      Services.obs.notifyObservers(update, "update-available", "show-prompt");
-      return;
-    }
-    if (!updateAuto) {' modules/UpdateService.sys.mjs
-	
 	# Avoid console warning about resource://gre/modules/FxAccountsCommon.js
 	replace_line 'const logins = this._data.logins;' 'const logins = this._data.logins; if (this._data.logins.length != -1) return;' modules/LoginStore.sys.mjs
 	
@@ -506,70 +497,9 @@ cd xulrunner
 
 if [ $BUILD_MAC == 1 ]; then
 	GECKO_VERSION="$GECKO_VERSION_MAC"
-	DOWNLOAD_URL="https://ftp.mozilla.org/pub/firefox/releases/$GECKO_VERSION"
-	rm -rf Firefox.app
-	
-	if [ -e "Firefox $GECKO_VERSION.app.zip" ]; then
-		echo "Using Firefox $GECKO_VERSION.app.zip"
-		unzip "Firefox $GECKO_VERSION.app.zip"
-	else
-		curl -o Firefox.dmg "$DOWNLOAD_URL/mac/en-US/Firefox%20$GECKO_VERSION.dmg"
-		set +e
-		hdiutil detach -quiet /Volumes/Firefox 2>/dev/null
-		set -e
-		hdiutil attach -quiet Firefox.dmg
-		cp -a /Volumes/Firefox/Firefox.app .
-		# Store local copy of unmodified app
-		zip -r "Firefox $GECKO_VERSION.app.zip" Firefox.app
-		hdiutil detach -quiet /Volumes/Firefox
-	fi
-	
-	# Download custom components (e.g., XUL), as an xz-compressed tarball of the MacOS folder with
-	# custom files in it
-	echo
-	rm -rf MacOS
-	if [ -n "$custom_components_hash_mac" ]; then
-		if [ -e "Firefox $GECKO_VERSION MacOS.zip" ]; then
-			echo "Using Firefox $GECKO_VERSION MacOS.zip"
-			unzip "Firefox $GECKO_VERSION MacOS.zip"
-		else
-			echo "Downloading custom Firefox components"
-			echo
-			curl -o MacOS.tar.xz "${custom_components_url}mac/$custom_components_hash_mac.tar.xz"
-			
-			# Verify hash
-			if [[ "`uname`" = "Darwin" ]]; then
-				shasum="shasum -a 256"
-			else
-				shasum=sha256sum
-			fi
-			echo
-			echo "$custom_components_hash_mac  MacOS.tar.xz" | $shasum -c -
-			echo
-			
-			tar xvf MacOS.tar.xz
-		fi
-		echo
-	fi
-	
 	pushd Firefox.app/Contents/Resources
 	modify_omni mac
 	popd
-	
-	# Replace "FirefoxCP" with "ZoteroCP" for subprocesses ("Isolated Web Content", "Socket Process", "Web Content", etc.)
-	info_plist=Firefox.app/Contents/MacOS/plugin-container.app/Contents/Resources/English.lproj/InfoPlist.strings
-	from=$(get_utf16_chars "FirefoxCP")
-	to=$(get_utf16_chars "ZoteroCP")
-	perl -pi -e "s/$from/$to/" $info_plist
-	# Check for UTF-16 "ZoteroCP"
-	if ! grep -a -q "Z.o.t.e.r.o.C.P." $info_plist; then
-		echo '"ZoteroCP" not found in InfoPlist.strings after replacement'
-		exit 1
-	fi
-	
-	rm -f Firefox.dmg
-	
-	echo $("$SCRIPT_DIR/xulrunner_hash" -p m) > hash-mac
 fi
 
 if [ $BUILD_WIN == 1 ]; then
@@ -709,9 +639,6 @@ if [ $BUILD_WIN == 1 ]; then
 fi
 
 if [ $BUILD_LINUX == 1 ]; then
-	GECKO_VERSION="$GECKO_VERSION_LINUX"
-	DOWNLOAD_URL="https://ftp.mozilla.org/pub/firefox/releases/$GECKO_VERSION"
-	
 	if [[ -n $arch ]]; then
 		arch_list=("$arch")
 	else
@@ -719,33 +646,11 @@ if [ $BUILD_LINUX == 1 ]; then
 	fi
 	for arch in "${arch_list[@]}"; do
 		xdir="firefox-linux-$arch"
-		rm -rf $xdir
-		
-		archived_file="firefox-$GECKO_VERSION-$arch.tar.xz"
-		if [ -e "$archived_file" ]; then
-			echo "Using $archived_file"
-			cp "$archived_file" "firefox-$GECKO_VERSION.tar.xz"
-		else
-			if [ $arch = "arm64" ]; then
-				moz_arch=aarch64
-			else
-				moz_arch=$arch
-			fi
-			curl -O "$DOWNLOAD_URL/linux-$moz_arch/en-US/firefox-$GECKO_VERSION.tar.xz"
-			# Store local copy of unmodified app
-			cp "firefox-$GECKO_VERSION.tar.xz" "$archived_file"
-		fi
-
-		tar xvf firefox-$GECKO_VERSION.tar.xz
-		mv firefox $xdir
 
 		pushd $xdir
 		modify_omni $arch
 		popd
 		
-		rm "firefox-$GECKO_VERSION.tar.xz"
-		
-		echo "$( $SCRIPT_DIR/xulrunner_hash -p l -a "$arch" )" > "hash-linux-${arch}"
 	done
 fi
 
+36 −0
Original line number Diff line number Diff line
diff --git a/app/build.sh b/app/build.sh
index de092bde16..2e58b687e7 100755
--- a/app/build.sh
+++ b/app/build.sh
@@ -644,11 +644,6 @@ if [ $BUILD_MAC == 1 ]; then
 		cp "$MAC_RUNTIME_PATH/../MacOS/XUL" "$CONTENTSDIR/MacOS/"
 	fi
 
-	# Use our own updater, because Mozilla's requires updates signed by Mozilla
-	cd "$CONTENTSDIR/MacOS"
-	check_lfs_file "$CALLDIR/mac/updater.tar.xz"
-	tar xf "$CALLDIR/mac/updater.tar.xz"
-
 	# Modify Info.plist
 	perl -pi -e "s/\{\{VERSION\}\}/$VERSION/" "$CONTENTSDIR/Info.plist"
 	perl -pi -e "s/\{\{VERSION_NUMERIC\}\}/$VERSION_NUMERIC/" "$CONTENTSDIR/Info.plist"
@@ -1027,11 +1022,6 @@ if [ $BUILD_LINUX == 1 ]; then
 		# Copy Ubuntu launcher files
 		cp "$CALLDIR/linux/zotero.desktop" "$APPDIR"
 		cp "$CALLDIR/linux/set_launcher_icon" "$APPDIR"
-		
-		# Use our own updater, because Mozilla's requires updates signed by Mozilla
-		check_lfs_file "$CALLDIR/linux/updater.tar.xz"
-		tar xf "$CALLDIR/linux/updater.tar.xz" --to-stdout updater-$arch > "$APPDIR/updater"
-		chmod 755 "$APPDIR/updater"
 
 		# Copy app files
 		rsync -a "$base_dir/" "$APPDIR/"
@@ -1041,6 +1031,7 @@ if [ $BUILD_LINUX == 1 ]; then
 		cp -RH "$CALLDIR/modules/zotero-libreoffice-integration/install" "$APPDIR/integration/libreoffice"
 		
 		# Copy icons
+		mkdir -p "$APPDIR/icons/"
 		cp "$CALLDIR/linux/icons/icon32.png" "$APPDIR/icons/"
 		cp "$CALLDIR/linux/icons/icon64.png" "$APPDIR/icons/"
 		cp "$CALLDIR/linux/icons/icon128.png" "$APPDIR/icons/"

pkgs/by-name/zo/zotero/darwin.nix

deleted100644 → 0
+0 −33
Original line number Diff line number Diff line
{
  pname,
  version,
  meta,
  stdenv,
  fetchurl,
  undmg,
}:

stdenv.mkDerivation (finalAttrs: {
  inherit pname version meta;

  src = fetchurl {
    url = "https://download.zotero.org/client/release/${finalAttrs.version}/Zotero-${finalAttrs.version}.dmg";
    hash = "sha256-lDf/jULLQyzxNVGRUKuF2df+FTbJK08z+fFQbVgwjsY=";
  };
  sourceRoot = ".";

  nativeBuildInputs = [ undmg ];

  dontConfigure = true;
  dontBuild = true;
  dontFixup = true; # breaks notarization

  installPhase = ''
    runHook preInstall

    mkdir -p $out/Applications
    cp -r Zotero.app $out/Applications

    runHook postInstall
  '';
})
+42 −0
Original line number Diff line number Diff line
diff --git a/js-build/note-editor.js b/js-build/note-editor.js
index 1435730342..bfd552f863 100644
--- a/js-build/note-editor.js
+++ b/js-build/note-editor.js
@@ -36,9 +36,6 @@ async function getZoteroNoteEditor(signatures) {
 			await fs.remove(path.join(targetDir, 'zotero'));
 		}
 		catch (e) {
-			console.error(e);
-			await exec('npm ci', { cwd: modulePath });
-			await exec('npm run build', { cwd: modulePath });
 			await fs.copy(path.join(modulePath, 'build', 'zotero'), targetDir);
 		}
 		signatures['note-editor'] = { hash };
diff --git a/js-build/pdf-worker.js b/js-build/pdf-worker.js
index b820304f3a..aafb6b1ef5 100644
--- a/js-build/pdf-worker.js
+++ b/js-build/pdf-worker.js
@@ -33,9 +33,6 @@ async function getPDFWorker(signatures) {
 			);
 		}
 		catch (e) {
-			console.error(e);
-			await exec('npm ci', { cwd: modulePath });
-			await exec('npm run build', { cwd: modulePath });
 			await fs.copy(path.join(modulePath, 'build', 'worker.js'), path.join(targetDir, 'worker.js'));
 		}
 		signatures['pdf-worker'] = { hash };
diff --git a/js-build/reader.js b/js-build/reader.js
index 67a02a3ad2..5de2f3ada8 100644
--- a/js-build/reader.js
+++ b/js-build/reader.js
@@ -36,9 +36,6 @@ async function getReader(signatures) {
 			await fs.remove(path.join(targetDir, 'zotero'));
 		}
 		catch (e) {
-			console.error(e);
-			await exec('npm ci', { cwd: modulePath });
-			await exec('npm run build', { cwd: modulePath });
 			await fs.copy(path.join(modulePath, 'build', 'zotero'), targetDir);
 		}
 		signatures['reader'] = { hash };
Loading