Fritzing-app ビルド手順補助 (暫定手順)

暫定手順です。
少しずつバージョンごとに更新したいと思います。
現在確認できているのは バージョン1.0.1のみです。

![スクリーンショット 2024-11-24 13.34.50.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/363815/ad3e1689-e940-b476-1fbc-2947dcc8da86.png)

```
❯ git clone https://github.com/fritzing/fritzing-app.git                               ~/work-fritzing20241124 via 11GiB/16GiB | 1GiB/3GiB 
Cloning into 'fritzing-app'...
remote: Enumerating objects: 50878, done.
remote: Counting objects: 100% (9244/9244), done.
remote: Compressing objects: 100% (1541/1541), done.
remote: Total 50878 (delta 7845), reused 8863 (delta 7690), pack-reused 41634 (from 1)
Receiving objects: 100% (50878/50878), 160.55 MiB | 12.36 MiB/s, done.
Resolving deltas: 100% (36731/36731), done.

❯ cd fritzing-app                                                             ~/work-fritzing20241124 via 11GiB/16GiB | 1GiB/3GiB took 15s 
Fritzing.1                              README.md                               pri
Fritzing.sh                             config.tests                            resources
FritzingInfo.plist                      docker                                  sketches
INSTALL.txt                             fritzing.rc                             src
LICENSE.CC-BY-SA                        help                                    test
LICENSE.GPL2                            license-openssl-ssleay.txt              tests
LICENSE.GPL3                            org.fritzing.Fritzing.appdata.xml       tools
LICENSE.LGPLv3                          org.fritzing.Fritzing.desktop           translations
LICENSE.Modified_BSD                    phoenix.pro
LICENSE_1_0.txt.BOOST                   phoenixresources.qrc

❯ git checkout a8c6ef7cf66f7a42b9b233d6137f1b70a9573a25                              fritzing-app on  develop via 11GiB/16GiB | 1GiB/3GiB 
Note: switching to 'a8c6ef7cf66f7a42b9b233d6137f1b70a9573a25'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by switching back to a branch.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -c with the switch command. Example:

  git switch -c <new-branch-name>

Or undo this operation with:

  git switch -

Turn off this advice by setting config variable advice.detachedHead to false

HEAD is now at a8c6ef7c Bump version to 1.0.4

❯                                                                             fritzing-app on  HEAD (a8c6ef7) via 11GiB/16GiB | 1GiB/3GiB 

```

![スクリーンショット 2024-11-24 13.39.24.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/363815/daaab0c6-079b-8b3d-c5e4-eebd590696c7.png)


```
❯ cd ..                                                                       fritzing-app on  HEAD (a8c6ef7) via 11GiB/16GiB | 1GiB/3GiB 
fritzing-app

❯ git clone https://github.com/fritzing/fritzing-parts.git --branch '1.0.4'            ~/work-fritzing20241124 via 11GiB/16GiB | 1GiB/3GiB 
Cloning into 'fritzing-parts'...
remote: Enumerating objects: 21911, done.
remote: Counting objects: 100% (2937/2937), done.
remote: Compressing objects: 100% (951/951), done.
remote: Total 21911 (delta 2059), reused 2600 (delta 1933), pack-reused 18974 (from 1)
Receiving objects: 100% (21911/21911), 141.61 MiB | 8.93 MiB/s, done.
Resolving deltas: 100% (15321/15321), done.
Updating files: 100% (9923/9923), done.

❯ cd fritzing-parts                                                           ~/work-fritzing20241124 via 11GiB/16GiB | 1GiB/3GiB took 19s 
CONTRIBUTING.md README.md       contrib         obsolete        svg
LICENSE.txt     bins            core            scripts         user

❯ git checkout 76235099ed556e52003de63522fdd74e61d53a36                              fritzing-parts on  1.0.4 via 11GiB/16GiB | 1GiB/3GiB 
Note: switching to '76235099ed556e52003de63522fdd74e61d53a36'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by switching back to a branch.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -c with the switch command. Example:

  git switch -c <new-branch-name>

Or undo this operation with:

  git switch -

Turn off this advice by setting config variable advice.detachedHead to false

HEAD is now at 76235099 Added Infineon_CY8CKIT-062S2-AI

❯                                                                           fritzing-parts on  HEAD (7623509) via 11GiB/16GiB | 1GiB/3GiB 

```

ライブラリ-ダウンロード

```
# - 同じ作業ディレクトリ以下にビルドに必要なライブラリを配置
## - boost v1.81.0 バージョン指定あり ビルド不要
curl -o boost_1_81_0.zip https://archives.boost.io/release/1.81.0/source/boost_1_81_0.zip

## - libgit2 v0.28.5 バージョン指定あり ★ビルド必要
wget -O libgit2-0.28.5.tar.gz https://github.com/libgit2/libgit2/releases/download/v0.28.5/libgit2-0.28.5.tar.gz

## - svgpp バージョン指定なし ビルド不要
wget -O svgpp-1.3.0.zip https://github.com/svgpp/svgpp/archive/refs/tags/v1.3.0.zip

## - quazip
# wget -O quazip-v1.4.zip https://github.com/stachenov/quazip/archive/refs/tags/v1.4.zip
# TODO:自前でのビルド手順が揃うまでの暫定対応
brew install quazip

## - ngspice v40　バージョン指定あり ビルド不要
wget -O ngspice-40.tar.gz https://sourceforge.net/projects/ngspice/files/ng-spice-rework/old-releases/40/ngspice-40.tar.gz/download

```

```
❯ mkdir download-tmp lib-temp                                                          ~/work-fritzing20241124 via 11GiB/16GiB | 1GiB/3GiB 

❯ cd download-tmp                                                                      ~/work-fritzing20241124 via 11GiB/16GiB | 1GiB/3GiB 

❯ # - 同じ作業ディレクトリ以下にビルドに必要なライブラリを配置            ~/work-fritzing20241124/download-tmp via 11GiB/16GiB | 1GiB/3GiB 
## - boost v1.81.0 バージョン指定あり ビルド不要
curl -o boost_1_81_0.zip https://archives.boost.io/release/1.81.0/source/boost_1_81_0.zip

## - libgit2 v0.28.5 バージョン指定あり ★ビルド必要
wget -O libgit2-0.28.5.tar.gz https://github.com/libgit2/libgit2/releases/download/v0.28.5/libgit2-0.28.5.tar.gz

## - svgpp バージョン指定なし ビルド不要
wget -O svgpp-1.3.0.zip https://github.com/svgpp/svgpp/archive/refs/tags/v1.3.0.zip

## - quazip
# wget -O quazip-v1.4.zip https://github.com/stachenov/quazip/archive/refs/tags/v1.4.zip
# TODO:自前でのビルド手順が揃うまでの暫定対応
brew install quazip

## - ngspice v40　バージョン指定あり ビルド不要
wget -O ngspice-40.tar.gz https://sourceforge.net/projects/ngspice/files/ng-spice-rework/old-releases/40/ngspice-40.tar.gz/download

zsh: command not found: #
zsh: command not found: ##
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  195M  100  195M    0     0  4603k      0  0:00:43  0:00:43 --:--:-- 5376k
zsh: command not found: ##
--2024-11-24 14:00:35--  https://github.com/libgit2/libgit2/releases/download/v0.28.5/libgit2-0.28.5.tar.gz
github.com (github.com) をDNSに問いあわせています... 20.27.177.113
github.com (github.com)|20.27.177.113|:443 に接続しています... 接続しました。
HTTP による接続要求を送信しました、応答を待っています... 302 Found
場所: https://objects.githubusercontent.com/github-production-release-asset-2e65be/901662/32a43d80-7433-11ea-88fa-98058b032a99?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=releaseassetproduction%2F20241124%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20241124T050035Z&X-Amz-Expires=300&X-Amz-Signature=6f43863e8f6022fffbf3a49254b060d465668a5adbd11cea6d5813370dad1509&X-Amz-SignedHeaders=host&response-content-disposition=attachment%3B%20filename%3Dlibgit2-0.28.5.tar.gz&response-content-type=application%2Foctet-stream [続く]
--2024-11-24 14:00:35--  https://objects.githubusercontent.com/github-production-release-asset-2e65be/901662/32a43d80-7433-11ea-88fa-98058b032a99?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=releaseassetproduction%2F20241124%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20241124T050035Z&X-Amz-Expires=300&X-Amz-Signature=6f43863e8f6022fffbf3a49254b060d465668a5adbd11cea6d5813370dad1509&X-Amz-SignedHeaders=host&response-content-disposition=attachment%3B%20filename%3Dlibgit2-0.28.5.tar.gz&response-content-type=application%2Foctet-stream
objects.githubusercontent.com (objects.githubusercontent.com) をDNSに問いあわせています... 185.199.109.133, 185.199.110.133, 185.199.111.133, ...
objects.githubusercontent.com (objects.githubusercontent.com)|185.199.109.133|:443 に接続しています... 接続しました。
HTTP による接続要求を送信しました、応答を待っています... 200 OK
長さ: 4998481 (4.8M) [application/octet-stream]
`libgit2-0.28.5.tar.gz' に保存中

libgit2-0.28.5.tar.gz              100%[================================================================>]   4.77M  --.-KB/s 時間 0.1s     

2024-11-24 14:00:37 (39.7 MB/s) - `libgit2-0.28.5.tar.gz' へ保存完了 [4998481/4998481]

zsh: command not found: ##
--2024-11-24 14:00:37--  https://github.com/svgpp/svgpp/archive/refs/tags/v1.3.0.zip
github.com (github.com) をDNSに問いあわせています... 20.27.177.113
github.com (github.com)|20.27.177.113|:443 に接続しています... 接続しました。
HTTP による接続要求を送信しました、応答を待っています... 302 Found
場所: https://codeload.github.com/svgpp/svgpp/zip/refs/tags/v1.3.0 [続く]
--2024-11-24 14:00:37--  https://codeload.github.com/svgpp/svgpp/zip/refs/tags/v1.3.0
codeload.github.com (codeload.github.com) をDNSに問いあわせています... 20.27.177.114
codeload.github.com (codeload.github.com)|20.27.177.114|:443 に接続しています... 接続しました。
HTTP による接続要求を送信しました、応答を待っています... 200 OK
長さ: 特定できません [application/zip]
`svgpp-1.3.0.zip' に保存中

svgpp-1.3.0.zip                        [   <=>                                                           ]   4.36M  10.3MB/s 時間 0.4s     

2024-11-24 14:00:38 (10.3 MB/s) - `svgpp-1.3.0.zip' へ保存終了 [4576009]

zsh: command not found: ##
zsh: command not found: #
zsh: command not found: #
==> Auto-updating Homebrew...
Adjust how often this is run with HOMEBREW_AUTO_UPDATE_SECS or disable with
HOMEBREW_NO_AUTO_UPDATE. Hide these hints with HOMEBREW_NO_ENV_HINTS (see `man brew`).
Warning: No remote 'origin' in /opt/homebrew/Library/Taps/sasa/homebrew-qt, skipping update!
Warning: No remote 'origin' in /opt/homebrew/Library/Taps/sasa/homebrew-qt-creator, skipping update!
Warning: quazip 1.4 is already installed and up-to-date.
To reinstall 1.4, run:
  brew reinstall quazip
zsh: command not found: ##
--2024-11-24 14:00:41--  https://sourceforge.net/projects/ngspice/files/ng-spice-rework/old-releases/40/ngspice-40.tar.gz/download
sourceforge.net (sourceforge.net) をDNSに問いあわせています... 2606:4700::6812:d95, 2606:4700::6812:c95, 104.18.13.149, ...
sourceforge.net (sourceforge.net)|2606:4700::6812:d95|:443 に接続しています... 接続しました。
HTTP による接続要求を送信しました、応答を待っています... 302 Found
場所: https://downloads.sourceforge.net/project/ngspice/ng-spice-rework/old-releases/40/ngspice-40.tar.gz?ts=gAAAAABnQrL55jvoSAPdoIZK6p7sh27yDPSBxAjQp_5hie8WHMJQRlrI7hu687AodsbxpkLgDwu0ok7eof0nnuMPixHAnDZmdA%3D%3D&use_mirror=altushost-swe&r= [続く]
--2024-11-24 14:00:41--  https://downloads.sourceforge.net/project/ngspice/ng-spice-rework/old-releases/40/ngspice-40.tar.gz?ts=gAAAAABnQrL55jvoSAPdoIZK6p7sh27yDPSBxAjQp_5hie8WHMJQRlrI7hu687AodsbxpkLgDwu0ok7eof0nnuMPixHAnDZmdA%3D%3D&use_mirror=altushost-swe&r=
downloads.sourceforge.net (downloads.sourceforge.net) をDNSに問いあわせています... 2606:4700::6812:d95, 2606:4700::6812:c95, 104.18.13.149, ...
downloads.sourceforge.net (downloads.sourceforge.net)|2606:4700::6812:d95|:443 に接続しています... 接続しました。
HTTP による接続要求を送信しました、応答を待っています... 302 Found
場所: https://altushost-swe.dl.sourceforge.net/project/ngspice/ng-spice-rework/old-releases/40/ngspice-40.tar.gz?viasf=1 [続く]
--2024-11-24 14:00:42--  https://altushost-swe.dl.sourceforge.net/project/ngspice/ng-spice-rework/old-releases/40/ngspice-40.tar.gz?viasf=1
altushost-swe.dl.sourceforge.net (altushost-swe.dl.sourceforge.net) をDNSに問いあわせています... 79.142.76.130
altushost-swe.dl.sourceforge.net (altushost-swe.dl.sourceforge.net)|79.142.76.130|:443 に接続しています... 接続しました。
HTTP による接続要求を送信しました、応答を待っています... 200 OK
長さ: 9431981 (9.0M) [application/x-gzip]
`ngspice-40.tar.gz' に保存中

ngspice-40.tar.gz                  100%[================================================================>]   8.99M  1.49MB/s 時間 6.0s     

2024-11-24 14:00:50 (1.49 MB/s) - `ngspice-40.tar.gz' へ保存完了 [9431981/9431981]


❯                                                                ~/work-fritzing20241124/download-tmp via 11GiB/16GiB | 1GiB/3GiB took 58s 

```

ライブラリ-解凍

```
# 解凍先のディレクトリが存在しない場合、作成
mkdir -p ~/work-fritzing20241124/lib-temp

# boost
echo "解凍中: boost_1_81_0.zip ..."
unzip -q boost_1_81_0.zip -d ~/work-fritzing20241124/lib-temp
echo "完了: boost_1_81_0.zip"

# libgit2
echo "解凍中: libgit2-0.28.5.tar.gz ..."
tar -xzf libgit2-0.28.5.tar.gz -C ~/work-fritzing20241124/lib-temp > /dev/null 2>&1

# ディレクトリ名をリネーム
echo "リネーム中: libgit2-0.28.5 -> libgit2 ..."
mv ~/work-fritzing20241124/lib-temp/libgit2-0.28.5 ~/work-fritzing20241124/lib-temp/libgit2
echo "完了: libgit2-0.28.5.tar.gz"


# svgpp
echo "解凍中: svgpp-1.3.0.zip ..."
unzip -q svgpp-1.3.0.zip -d ~/work-fritzing20241124/lib-temp
echo "完了: svgpp-1.3.0.zip"

# ngspice
echo "解凍中: ngspice-40.tar.gz ..."
tar -xzf ngspice-40.tar.gz -C ~/work-fritzing20241124/lib-temp > /dev/null 2>&1
echo "完了: ngspice-40.tar.gz"

echo "すべての解凍が完了しました。"
```
```
 boost_1_81_0.zip   libgit2-0.28.5.tar.gz   ngspice-40.tar.gz   svgpp-1.3.0.zip

❯ # 解凍先のディレクトリが存在しない場合、作成                            ~/work-fritzing20241124/download-tmp via 11GiB/16GiB | 1GiB/3GiB 
mkdir -p ~/work-fritzing20241124/lib-temp

# boost
echo "解凍中: boost_1_81_0.zip ..."
unzip -q boost_1_81_0.zip -d ~/work-fritzing20241124/lib-temp
echo "完了: boost_1_81_0.zip"

# libgit2
echo "解凍中: libgit2-0.28.5.tar.gz ..."
tar -xzf libgit2-0.28.5.tar.gz -C ~/work-fritzing20241124/lib-temp > /dev/null 2>&1

# ディレクトリ名をリネーム
echo "リネーム中: libgit2-0.28.5 -> libgit2 ..."
mv ~/work-fritzing20241124/lib-temp/libgit2-0.28.5 ~/work-fritzing20241124/lib-temp/libgit2
echo "完了: libgit2-0.28.5.tar.gz"


# svgpp
echo "解凍中: svgpp-1.3.0.zip ..."
unzip -q svgpp-1.3.0.zip -d ~/work-fritzing20241124/lib-temp
echo "完了: svgpp-1.3.0.zip"

# ngspice
echo "解凍中: ngspice-40.tar.gz ..."
tar -xzf ngspice-40.tar.gz -C ~/work-fritzing20241124/lib-temp > /dev/null 2>&1
echo "完了: ngspice-40.tar.gz"

echo "すべての解凍が完了しました。"
zsh: command not found: #
zsh: command not found: #
解凍中: boost_1_81_0.zip ...
完了: boost_1_81_0.zip
zsh: command not found: #
解凍中: libgit2-0.28.5.tar.gz ...
zsh: command not found: #
リネーム中: libgit2-0.28.5 -> libgit2 ...
完了: libgit2-0.28.5.tar.gz
zsh: command not found: #
解凍中: svgpp-1.3.0.zip ...
完了: svgpp-1.3.0.zip
zsh: command not found: #
解凍中: ngspice-40.tar.gz ...
完了: ngspice-40.tar.gz
すべての解凍が完了しました。

❯                                                                ~/work-fritzing20241124/download-tmp via 11GiB/16GiB | 1GiB/3GiB took 16s 

```

![スクリーンショット 2024-11-24 14.26.08.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/363815/ccef7b00-27ae-c585-4702-d00afb76816b.png)




```
# ライブラリのビルド作業
## libgit2-0.28.5のビルド
cd libgit2
mkdir build
cd build
pyenv local 3.8.19 
python3 -m venv venv   
source venv/bin/activate 

# wikiに従い -DBUILD_SHARED_LIBS=OFF オプションを追加 
cmake -DBUILD_SHARED_LIBS=OFF ..
cmake --build .
```