在 Linux Mint 18 上編譯 Transmission-GTK torrent 用戶端

在 Linux Mint 18 上編譯 Transmission-GTK torrent 用戶端

如何transmission-gtk在 Linux Mint 18 或一般基於 Ubuntu 16.04 的系統上從原始碼編譯 torrent 用戶端?

假設我想:

  1. 刪除原來的打包版本。
  2. 替換它,同時保留原來的設定、桌面項目等。

答案1

在此編譯過程中,需要明確的是,它是為當今的當前版本2.92 以及基於Ubuntu 16.04 的系統(如Linux Mint 18)編寫的。不同。

  1. 前往官方頁面;透過安全協議,目前官方頁面沒有重定向到HTTPS;您可以使用下面的連結造訪該網頁:

    https://transmissionbt.com/download/

  2. 導航原始碼部分並下載當前的部分;它使用 GitHub 儲存庫;如果你在 CLI 中,你可以使用這個直接方法:

    wget --continue https://github.com/transmission/transmission-releases/raw/master/transmission-2.92.tar.xz
    
  3. 檢查 SHA-256 哈希匹配;官方下載頁面有寫;對於版本 2.92,以下內容適用:

     sha256sum transmission-2.92.tar.xz
    
    3a8d045c306ad9acb7bf81126939b9594553a388482efa0ec1bfb67b22acd35f
    
  4. 提取存檔:

     tar -xJvf transmission-2.92.tar.xz
    
  5. 進入解壓縮目錄:

     cd transmission-2.92/
    
  6. 現在我們需要安裝建置依賴項transmission-gtk

     sudo apt-get build-dep transmission-gtk
    
  7. 讓我們確保所有先決條件都已安裝,根據這個 GitHub 頁面:

     sudo apt-get install build-essential automake autoconf libtool pkg-config intltool libcurl4-openssl-dev libglib2.0-dev libevent-dev libminiupnpc-dev libappindicator-dev
    

    請注意,我必須將其刪除libminiupnpc5libminiupnpc-dev替換它。

  8. 運行配置腳本:

     ./configure
    

    以下可選參數可以傳遞到配置腳本(從配置腳本複製貼上):

    Optional Features:
    
     --disable-option-checking  ignore unrecognized --enable/--with options
     --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
     --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
     --enable-silent-rules   less verbose build output (undo: "make V=1")
     --disable-silent-rules  verbose build output (undo: "make V=0")
     --enable-shared[=PKGS]  build shared libraries [default=yes]
     --enable-static[=PKGS]  build static libraries [default=yes]
     --enable-fast-install[=PKGS]
                             optimize for fast installation [default=yes]
     --enable-dependency-tracking
                             do not reject slow dependency extractors
     --disable-dependency-tracking
                             speeds up one-time build
     --disable-libtool-lock  avoid locking (might break parallel builds)
     --disable-largefile     omit support for large files
     --enable-external-dht   Use system external-dht
     --enable-external-b64   Use system libb64
     --enable-utp            build µTP support
     --enable-external-natpmp
                             Use system external-natpmp
     --enable-nls            enable native language support
     --disable-nls           do not use Native Language Support
     --enable-lightweight    optimize libtransmission for low-resource systems:
                             smaller cache size, prefer unencrypted peer
                             connections, etc.
     --enable-cli            build command-line client
     --enable-mac            build Mac client
     --enable-daemon         build daemon
    
Optional Packages:
    --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
    --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
    --with-pic[=PKGS]       try to use only PIC/non-PIC objects [default=use
                      both]
    --with-aix-soname=aix|svr4|both
                            shared library versioning (aka "SONAME") variant to
                            provide on AIX, [default=aix].
    --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
    --with-sysroot[=DIR]    Search for dependent libraries within DIR (or the
                            compiler's sysroot if not specified).
    --with-crypto=PKG       Use specified crypto library: auto (default),
                            openssl, cyassl, polarssl
    --with-inotify          Enable inotify support (default=auto)
    --with-kqueue           Enable kqueue support (default=auto)
    --with-systemd-daemon   Add support for systemd startup notification
                            (default is autodetected)
    --with-gtk              with Gtk
  1. 檢查配置腳本的輸出是否與以下內容相符(如果這是您想要的):

     Configuration:
    
        Source code location:                              .
        Compiler:                                          g++
    
        Build libtransmission:                             yes
           * optimized for low-resource systems:           no
           * µTP enabled:                                  yes
           * crypto library:                               openssl
    
        Build Command-Line client:                         no
    
        Build GTK+ client:                                 yes
           * libappindicator for an Ubuntu-style tray:     yes
    
        Build Daemon:                                      yes
    
        Build Mac client:                                  no
    

    如果沒有問題,您可以繼續,否則您需要解決問題。

  2. 編譯程序,這可能需要一段時間:

    make
    

    如果編譯成功則可以繼續,否則需要排除問題。

  3. 在安裝之前,您可能希望從儲存庫中刪除已安裝的相當舊的穩定版本,但有一個問題:您可能想要保留您的設置,如果是這樣,請找到設定檔:

    locate transmission/settings.json
    
  4. 假設它在您的個人~/.config/目錄中。在某處進行備份,例如備份到您的主目錄中:

    cp ~/.config/transmission/settings.json ~/
    
  5. 現在刪除原先的打包版本:

    sudo apt-get purge transmission-gtk transmission-common
    
  6. 安裝編譯好的transmission-gtk客戶端:

    sudo make install
    
  7. 當客戶端沒有transmission-gtk啟動時,您可以將設定檔移至,或者最好先檢查差異,然後決定是否要覆寫它:

    mv ~/settings.json ~/.config/transmission/settings.json
    
  8. 最後假設您想要一個桌面項目,然後複製它並將其標記為可執行檔:

    cp ~/Downloads/transmission-2.92/gtk/transmission-gtk.desktop ~/Desktop/
    
    chmod a+x ~/Desktop/transmission-gtk.desktop
    
  9. 同樣,您可以建立一個選單項,您只需要新增sudo而不用擔心執行位:

    sudo cp ~/Downloads/transmission-2.92/gtk/transmission-gtk.desktop /usr/share/applications/
    

相關內容