Package Details: ltspice 24.1.6-1

Git Clone URL: https://aur.archlinux.org/ltspice.git (read-only, click to copy)
Package Base: ltspice
Description: SPICE simulator, schematic capture and waveform viewer.
Upstream URL: https://www.analog.com/en/resources/design-tools-and-calculators/ltspice-simulator.html
Keywords: simulation spice wine
Licenses: LicenseRef-LTspice
Submitter: M4a1x
Maintainer: fenugrec
Last Packager: fenugrec
Votes: 35
Popularity: 0.54
First Submitted: 2015-07-08 21:35 (UTC)
Last Updated: 2025-03-31 19:10 (UTC)

Pinned Comments

fenugrec commented on 2025-01-22 23:08 (UTC) (edited on 2025-01-23 17:25 (UTC) by fenugrec)

(follow-up) - yeah, currently it's a bit of a mess :

  • I found permalinks, like https://ltspice.analog.com/download/24.1.0/LTspice64.msi
  • the above is the same file as what you currently (2025/01/25) get from https://ltspice.analog.com/software/LTspice64.msi
  • the version string in the .json file is not 24.1.0 as expected, but '24.0.12' ....
  • if you download https://ltspice.analog.com/download/24.0.12/LTspice64.msi, the .json says 24.0.11...

I'm going to try using a permalink, just so the build doesn't break on their next update, but I may not notice for a while to update the PKGBUILD. We can revisit this if analog gets their versioning straightened out.

Latest Comments

« First ‹ Previous 1 2 3 4 5 6 7 Next › Last »

apaulsen commented on 2025-01-02 19:57 (UTC)

Thanks! It built for me now.

fenugrec commented on 2025-01-02 19:31 (UTC)

@apaulsen - oops, fixed, thanks. Also restored "F1 to launch help", although the internal hyperlinks still don't work due to lowercase.

apaulsen commented on 2025-01-02 19:16 (UTC)

Looks like the sha256sums for these scripts need to be updated:

${pkgname}.sh ${pkgname}-help.sh

fenugrec commented on 2025-01-02 17:54 (UTC) (edited on 2025-01-02 18:06 (UTC) by fenugrec)

@c0d3z3r0 , @flaviut I have adopted this package, merged your changes, and updated to latest version 24. "works for me", but let me know if this breaks again or if you think of other improvements.

RFC :

  • I think we don't need to create $HOME/.ltspice , that's where the wineprefix was set previously ?

  • in fixing the 'ltspice-help.sh' launcher, I temporarily broke the builtin help (i.e. pressing F1) which doesn't find the .htm files (that were moved to /usr/share/doc...). Interested in ideas on this; I think a single symlink would fix it. Will test.

  • the help files assume a case-insensitive FS for its internal links (e.g. a hyperlink to GeneralStructureandConventions.htm fails because the actual filename is lowercase). I don't believe the lowercase is due to msiextract, I tried alternate extractors and the filenames just seem to be like that. Not sure what to do about this.

c0d3z3r0 commented on 2023-11-01 15:50 (UTC)

Patch for updating to newer non-roman version 17.x.x. Changes: - Drop _download et al. like flaviut did - Adapt dependencies - Make use of msiextract (7z not working any more) - Rework versioning (Changelog only contains data version; there is a json file now for the ltspice version) - Change wine path to .local/share/wineprefixes/ltspice - some additional cleanup

diff --git a/PKGBUILD b/PKGBUILD
index 962dec5..00912b1 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,167 +1,79 @@
 # Maintainer: Jan-Henrik Bruhn <aur@jhbruhn.de>
 # Contributor: Max Stabel <max dot stabel03 at gmail dot com>

-_ltspice_ver_roman="XVII"
-_ltspice_ver="17"
-
 pkgname=ltspice
-pkgver=17.20211222.2
+pkgver=17.1.14.20230928.13
 pkgrel=1
 pkgdesc="SPICE simulator, schematic capture and waveform viewer. Installation based on Field Update Utility."
 arch=('x86_64')
 url="http://www.linear.com/designtools/software/"
 license=('custom')
 depends=('wine')
-makedepends=('git' 'curl' 'cksfv' 'icoutils' 'imagemagick' 'gendesk')
-
-_update_url="https://ltspice.analog.com/fieldsync$_ltspice_ver_roman"
-
-source=("$pkgname.sh"
-        "$pkgname-help.sh")
-sha256sums=('7b73449a9b7de53b65d132a40fdee3c8706181a7b699c362e399e67c92bedc58'
-            'ff14cff95172bbf685bc39801910edd70ee9499dee450270529c043946cc591c')
-_curl_opts="-s --connect-timeout 60 --retry 3 --retry-delay 1"
-
-_download_file() {
-    file=$1
-    crc=$2
-        
-    _download=true
-    # check whether cached file with correct CRC exists
-    if [ -s "$pkgname/$file" ]; then
-        f_crc=$(cksfv -c "$pkgname/$file" | sed '/^;/d' | awk '{print $2}')
-        if [ "$crc" = "$f_crc" ]; then
-            _download=false
-        fi
-    fi
-
-    if [ "$_download" = true ]; then
-        mkdir -p "${pkgname}/$(dirname $file)"
-
-        output="$pkgname/$file"
-        if [ -f "$output" ]; then
-            rm -f $output
-        fi
-        # first try compressed path and decompress
-        url="${_update_url}/${file}.gz"
-        compressed="${pkgname}/${file}.gz"
-        curl -f $_curl_opts $url > $compressed && curlcode=$? || curlcode=$?
-        if [ -s "$compressed" ] && [ $curlcode -eq 0 ]; then
-            # echo "compressed: $output"
-            cat $compressed | gunzip > $output
-            rm $compressed
-        fi 
-        # download uncompressed file if compressed was not found
-        if [ ! -s "$output" ]; then
-            url="${_update_url}/${file}"
-            curl  $_curl_opts -S $url > $output && curlcode=$? || curlcode=$?
-        fi
-
-        if [ ! -s "$output" ] || [ $curlcode -ne 0 ]; then
-            echo "Download error ($curlcode): $output / $url"
-            echo ""
-        # else
-            # echo "uncompressed: $output"
-        fi
-    fi
-    return 0
-}
+makedepends=('curl' 'icoutils' 'imagemagick' 'gendesk' 'msitools')

-# initialize a semaphore with a given number of tokens
-open_sem(){
-    mkfifo pipe-$$
-    exec 3<>pipe-$$
-    rm pipe-$$
-    local i=$1
-    for((;i>0;i--)); do
-        printf %s 000 >&3
-    done
-}
-
-# run the given command asynchronously and pop/push tokens
-run_with_lock(){
-    local x
-    # this read waits until there is something to read
-    read -u 3 -n 3 x && ((0==x)) || exit $x
-    (
-     ( "$@"; )
-    # push the return code of the command to the semaphore
-    printf '%.3d' $? >&3
-    )&
-}
+source=("${pkgname}.sh"
+        "${pkgname}-help.sh"
+        "https://ltspice.analog.com/software/LTspice64.msi")
+sha256sums=('69080c30dee9c0141bbe04684c31f1896565778cbe3705cd4eb0996ed31d6c2e'
+            '25fdb185aea9752b1739d5787f9c180ddd5be728f25ebb6877075be272e79195'
+            '6718abbd4f4faefe375c579de775151525a9a1cca821041796588a6ec05a5c99')

-N=$(($(nproc) * 4))
-open_sem $N
+OPTIONS=(!strip)

 prepare() {
-    mkdir -p $pkgname
-
-    _download_file "Changelog.txt" ""
-    release_logs="$_update_url/release.log.gz"
-    
-    curl $_curl_opts "$release_logs" | gunzip > ./release.log
-    
-    total=$(cat release.log | sed '/^#/d' | wc -l)
-    count=0
-    echo "Checking cache and downloading using $N threads."
-    echo "Starting..."
-    for entry in $(cat release.log | sed '/^#/d' | awk '{print $6"/"$8}')
-    do
-        IFS='/' read -ra entry <<< "$entry"
-        file="${entry[1]//'\'/"/"}"
-        file="${file:2}"
-        file="${file//$'\n'}"
-        file="${file//$'\r'}"
-        crc=${entry[0]}
-        # download files from list, checking the CRC (something is still wrong with the CRC it seems)
-        run_with_lock _download_file "$file" "$crc"
-        count=$((count+1))
-        echo -n -e "\033[1K\rDownload Progress: $count/$total ($file)"
-    done
-    
-    wait
-
-    echo ""
-
-    echo "Downloaded all files!"
+    cd "${srcdir}"

+    msiextract LTspice64.msi
+    mv -f "APPDIR:."/* .
+    mv -f "LocalAppDataFolder/LTspice"/* .
 }

 build() {
-    wrestool -x -t 14 "${srcdir}/${pkgname}/XVIIx64.exe" > ${srcdir}/$pkgname.ico
-    convert ${srcdir}/ltspice.ico ${srcdir}/$pkgname.png
-    rm ${srcdir}/$pkgname.ico
+    cd "${srcdir}"

-    gendesk --pkgname "$pkgname" --pkgdesc "$pkgdesc" -n --name="LTSpice" --exec="/usr/bin/ltspice" -f
+    wrestool -x -t 14 LTspice.exe >${pkgname}.ico
+    convert ${pkgname}.ico ${pkgname}.png
+    rm ${pkgname}.ico
+
+    gendesk --pkgname "${pkgname}" --pkgdesc "${pkgdesc}" -n --name="LTSpice" --exec="/usr/bin/ltspice" -f
 }

 package()
 {
-    cd "$pkgname"
+    cd "${srcdir}"

     # Install License
     install -Dm644 License.txt "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"

     # Install Desktop file
-    install -Dm644 ${srcdir}/ltspice.png "${pkgdir}/usr/share/pixmaps/${pkgname}.png"
-    install -Dm644 "${srcdir}/$pkgname.desktop" "$pkgdir/usr/share/applications/$pkgname.desktop"
+    install -Dm644 "${pkgname}.png" "${pkgdir}/usr/share/pixmaps/${pkgname}.png"
+    install -Dm644 "${pkgname}.desktop" "${pkgdir}/usr/share/applications/${pkgname}.desktop"

     # Install docs to /usr/share/doc/
     install -Dm644 LTspiceHelp.chm "${pkgdir}/usr/share/doc/${pkgname}/ltspice.chm"

     # Install binary files to /opt
-    install -m755 -d "$pkgdir/opt/$pkgname"
-    cp -r * "$pkgdir/opt/$pkgname"
-
-    #Install /usr/bin startscript
-    install -Dm755 "$srcdir/$pkgname.sh" "$pkgdir/usr/bin/$pkgname"
-    install -Dm755 "$srcdir/$pkgname-help.sh" "$pkgdir/usr/bin/$pkgname-help"
+    install -m755 -d "${pkgdir}/opt/${pkgname}"
+    install -m755 *.exe "${pkgdir}/opt/${pkgname}"
+    install -m644 *.zip "${pkgdir}/opt/${pkgname}"
+    install -m644 LTspice.json "${pkgdir}/opt/${pkgname}"
+    install -m644 ChangeLog.txt "${pkgdir}/opt/${pkgname}"
+
+    # Install /usr/bin startscript
+    install -Dm755 "${srcdir}/${pkgname}.sh" "${pkgdir}/usr/bin/${pkgname}"
+    install -Dm755 "${srcdir}/${pkgname}-help.sh" "${pkgdir}/usr/bin/${pkgname}-help"
 }

 pkgver() {
-    cd "$pkgname"
-    date=$(cat Changelog.txt | head -n1 | awk '{print $1}')
-    count=$(grep -c "$date" Changelog.txt)
+    cd "${srcdir}"
+
+    # program
+    ver=$(grep LTspice64.msi LTspice.json -A1 | tail -n1 | grep -oP '17\.\d+\.\d+')
+
+    # data
+    date=$(head -n1 ChangeLog.txt | awk '{print $1}')
+    count=$(grep -c "$date" ChangeLog.txt)
     date_format=$(echo $date | awk -F/ '{print "20"$3$1$2}')
-    echo "$_ltspice_ver.$date_format.$count"
+
+    echo "$ver.$date_format.$count"
 }
diff --git a/ltspice-help.sh b/ltspice-help.sh
index 7552a3d..973f4fa 100644
--- a/ltspice-help.sh
+++ b/ltspice-help.sh
@@ -1,3 +1,4 @@
 #!/bin/sh
-export WINEPREFIX=$HOME/.ltspice/env WINEARCH=win64
+
+export WINEPREFIX=$HOME/.local/share/wineprefixes/ltspice WINEARCH=win64
 wine hh /usr/share/doc/ltspice/ltspice.chm "$@"
diff --git a/ltspice.sh b/ltspice.sh
index ae0032d..88c778d 100644
--- a/ltspice.sh
+++ b/ltspice.sh
@@ -1,11 +1,12 @@
 #!/bin/sh
+
 CONFIG_DIR="${XDG_CONFIG_HOME:-$HOME/.config}/ltspice"
 if [ ! -d "$HOME"/.ltspice ] ; then
    mkdir -p "$HOME"/.ltspice
 fi
 if [ ! -d $CONFIG_DIR ]; then
-   mkdir -p $CONFIG_DIR 
-   touch $CONFIG_DIR/LTspiceXVII.ini
+   mkdir -p $CONFIG_DIR
+   touch $CONFIG_DIR/LTspice.ini
 fi
-export WINEPREFIX=$HOME/.ltspice/env WINEARCH=win64
-wine /usr/lib/wine/x86_64-windows/start.exe /unix /opt/ltspice/XVIIx64 -ini $CONFIG_DIR/LTspiceXVII.ini "$@"
+export WINEPREFIX=$HOME/.local/share/wineprefixes/ltspice WINEARCH=win64
+wine /usr/lib/wine/x86_64-windows/start.exe /unix /opt/ltspice/LTspice.exe -ini $CONFIG_DIR/LTspice.ini "$@"

flaviut commented on 2023-08-30 21:37 (UTC)

7za e LTspice64.msi works well for extracting MSIs. I stripped out a lot that I don't understand from the package, but this seems to work OK:

diff --git a/PKGBUILD b/PKGBUILD
index 962dec5..6049813 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -5,7 +5,7 @@ _ltspice_ver_roman="XVII"
 _ltspice_ver="17"

 pkgname=ltspice
-pkgver=17.20211222.2
+pkgver=17.20230725.22
 pkgrel=1
 pkgdesc="SPICE simulator, schematic capture and waveform viewer. Installation based on Field Update Utility."
 arch=('x86_64')
@@ -17,127 +17,32 @@ makedepends=('git' 'curl' 'cksfv' 'icoutils' 'imagemagick' 'gendesk')
 _update_url="https://ltspice.analog.com/fieldsync$_ltspice_ver_roman"

 source=("$pkgname.sh"
-        "$pkgname-help.sh")
-sha256sums=('7b73449a9b7de53b65d132a40fdee3c8706181a7b699c362e399e67c92bedc58'
-            'ff14cff95172bbf685bc39801910edd70ee9499dee450270529c043946cc591c')
-_curl_opts="-s --connect-timeout 60 --retry 3 --retry-delay 1"
-
-_download_file() {
-    file=$1
-    crc=$2
-        
-    _download=true
-    # check whether cached file with correct CRC exists
-    if [ -s "$pkgname/$file" ]; then
-        f_crc=$(cksfv -c "$pkgname/$file" | sed '/^;/d' | awk '{print $2}')
-        if [ "$crc" = "$f_crc" ]; then
-            _download=false
-        fi
-    fi
-
-    if [ "$_download" = true ]; then
-        mkdir -p "${pkgname}/$(dirname $file)"
-
-        output="$pkgname/$file"
-        if [ -f "$output" ]; then
-            rm -f $output
-        fi
-        # first try compressed path and decompress
-        url="${_update_url}/${file}.gz"
-        compressed="${pkgname}/${file}.gz"
-        curl -f $_curl_opts $url > $compressed && curlcode=$? || curlcode=$?
-        if [ -s "$compressed" ] && [ $curlcode -eq 0 ]; then
-            # echo "compressed: $output"
-            cat $compressed | gunzip > $output
-            rm $compressed
-        fi 
-        # download uncompressed file if compressed was not found
-        if [ ! -s "$output" ]; then
-            url="${_update_url}/${file}"
-            curl  $_curl_opts -S $url > $output && curlcode=$? || curlcode=$?
-        fi
-
-        if [ ! -s "$output" ] || [ $curlcode -ne 0 ]; then
-            echo "Download error ($curlcode): $output / $url"
-            echo ""
-        # else
-            # echo "uncompressed: $output"
-        fi
-    fi
-    return 0
-}
-
-# initialize a semaphore with a given number of tokens
-open_sem(){
-    mkfifo pipe-$$
-    exec 3<>pipe-$$
-    rm pipe-$$
-    local i=$1
-    for((;i>0;i--)); do
-        printf %s 000 >&3
-    done
-}
-
-# run the given command asynchronously and pop/push tokens
-run_with_lock(){
-    local x
-    # this read waits until there is something to read
-    read -u 3 -n 3 x && ((0==x)) || exit $x
-    (
-     ( "$@"; )
-    # push the return code of the command to the semaphore
-    printf '%.3d' $? >&3
-    )&
-}
+        "$pkgname-help.sh"
+        "https://ltspice.analog.com/software/LTspice64.msi")
+sha256sums=('6a3098b1025e8697a0ec289c50f0b37302c89522fb06cf2f475097f71a064dc9'
+            'ff14cff95172bbf685bc39801910edd70ee9499dee450270529c043946cc591c'
+            '48998b09194bf2d56aae3d36810bb3ae536e7c60fba76a30de78107742e5ea7a')

-N=$(($(nproc) * 4))
-open_sem $N
+OPTIONS=(!strip)

 prepare() {
-    mkdir -p $pkgname
-
-    _download_file "Changelog.txt" ""
-    release_logs="$_update_url/release.log.gz"
-    
-    curl $_curl_opts "$release_logs" | gunzip > ./release.log
-    
-    total=$(cat release.log | sed '/^#/d' | wc -l)
-    count=0
-    echo "Checking cache and downloading using $N threads."
-    echo "Starting..."
-    for entry in $(cat release.log | sed '/^#/d' | awk '{print $6"/"$8}')
-    do
-        IFS='/' read -ra entry <<< "$entry"
-        file="${entry[1]//'\'/"/"}"
-        file="${file:2}"
-        file="${file//$'\n'}"
-        file="${file//$'\r'}"
-        crc=${entry[0]}
-        # download files from list, checking the CRC (something is still wrong with the CRC it seems)
-        run_with_lock _download_file "$file" "$crc"
-        count=$((count+1))
-        echo -n -e "\033[1K\rDownload Progress: $count/$total ($file)"
-    done
-    
-    wait
-
-    echo ""
-
-    echo "Downloaded all files!"
+    cd "${srcdir}"
+    7za e LTspice64.msi -aoa

 }

 build() {
-    wrestool -x -t 14 "${srcdir}/${pkgname}/XVIIx64.exe" > ${srcdir}/$pkgname.ico
-    convert ${srcdir}/ltspice.ico ${srcdir}/$pkgname.png
-    rm ${srcdir}/$pkgname.ico
+    cd "${srcdir}"
+    wrestool -x -t 14 LTspice.exe > $pkgname.ico
+    convert ltspice.ico $pkgname.png
+    rm $pkgname.ico

     gendesk --pkgname "$pkgname" --pkgdesc "$pkgdesc" -n --name="LTSpice" --exec="/usr/bin/ltspice" -f
 }

 package()
 {
-    cd "$pkgname"
+    cd "${srcdir}"

     # Install License
     install -Dm644 License.txt "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
@@ -151,7 +56,8 @@ package()

     # Install binary files to /opt
     install -m755 -d "$pkgdir/opt/$pkgname"
-    cp -r * "$pkgdir/opt/$pkgname"
+    cp -r ./*.exe "$pkgdir/opt/$pkgname"
+    cp -r lib.zip examples.zip "$pkgdir/opt/$pkgname"

     #Install /usr/bin startscript
     install -Dm755 "$srcdir/$pkgname.sh" "$pkgdir/usr/bin/$pkgname"
@@ -159,9 +65,9 @@ package()
 }

 pkgver() {
-    cd "$pkgname"
-    date=$(cat Changelog.txt | head -n1 | awk '{print $1}')
-    count=$(grep -c "$date" Changelog.txt)
+    cd "${srcdir}"
+    date=$(cat ChangeLog.txt_1 | head -n1 | awk '{print $1}')
+    count=$(grep -c "$date" ChangeLog.txt_1)
     date_format=$(echo $date | awk -F/ '{print "20"$3$1$2}')
     echo "$_ltspice_ver.$date_format.$count"
 }
diff --git a/ltspice.sh b/ltspice.sh
index ae0032d..8ef0eb0 100644
--- a/ltspice.sh
+++ b/ltspice.sh
@@ -8,4 +8,4 @@ if [ ! -d $CONFIG_DIR ]; then
    touch $CONFIG_DIR/LTspiceXVII.ini
 fi
 export WINEPREFIX=$HOME/.ltspice/env WINEARCH=win64
-wine /usr/lib/wine/x86_64-windows/start.exe /unix /opt/ltspice/XVIIx64 -ini $CONFIG_DIR/LTspiceXVII.ini "$@"
+wine /usr/lib/wine/x86_64-windows/start.exe /unix /opt/ltspice/LTspice.exe -ini $CONFIG_DIR/LTspiceXVII.ini "$@"

k1ngjulien commented on 2023-07-02 22:29 (UTC) (edited on 2023-07-02 22:30 (UTC) by k1ngjulien)

Alright I've played around a bit and I'm yet to find a good way to run the installer MSI automatically without user input. Any suggestions would be great.

As a solid workaround, I have been able to install the latest LTSpice version and run all the updates with no issues using Play on Linux.

Just use the "Install a non-listed program" option when installing.

k1ngjulien commented on 2023-06-28 15:47 (UTC)

It seems the "Web Sync" update process only works when running lt spice as root. as non root i always get "Trouble installing file .\lib\sub\LT3013.lib" after it loads the changelog and checks my local library

Once i've run it as root, the update succedes as a user as well, saying there's nothing to do.

Seems like a simple permission issue, like the updater not being allowed to write the data where it wants.

hrm commented on 2023-04-22 18:05 (UTC)

Hi! After upgrade of the package the new version is not set properly, triggering perpetual upgrades every time I use my AUR helper.

abd commented on 2023-04-22 06:28 (UTC)

is there another minimal installation configuration ?

this's painful to anyone has cheap, low quality ISP subscription