2016-12-08 67 views
0

我從git得到了Atom(從https://github.com/atom/atom),並在前一段時間檢出了1.5.0-beta0版本,當時我建立了一個32位的deb;我在Ubuntu 14.04上。從源代碼構建舊版本的Atom文本編輯器?

現在,我想建立完全相同的版本,作爲一個64位的deb。我認爲這將是簡單的,所以我只是在git的源文件夾中發出:

script/build 
script/grunt mkdeb 

它讓我/tmp/atom-build/atom-1.5.0-beta0-amd64.deb,但是當我安裝了它,它告訴我:

/usr/share/atom/atom: error while loading shared libraries: libnotify.so.4: cannot open shared object file: No such file or directory 

...這很奇怪,因爲我的64位系統上:

$ locate libnotify.so.4 
/usr/lib/x86_64-linux-gnu/libnotify.so.4 
/usr/lib/x86_64-linux-gnu/libnotify.so.4.0.0 

我認爲,它不可能是,是的​​構建系統不能與32位和64位建立區分?但它轉向正是因爲我試圖LD_LIBRARY_PATH=/usr/lib/x86_64-linux-gnu atom,它給了我一些錯誤(編輯:最有可能的是:「/usr/share/atom/atom: error while loading shared libraries: libnotify.so.4: wrong ELF class: ELFCLASS64」),指出我可能確實有這個問題...

大。好了,現在我試圖清理第一:

script/clean 
script/build 

現在,當我通過無線網絡在這裏做的構建,npm(或apm)會完全堵塞我的互聯網連接,最終生成的消息,如:

.... 
Installing build modules... 
npm ERR! fetch failed https://registry.npmjs.org/minimatch/-/minimatch-0.3.0.tgz 
npm ERR! fetch failed https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.5.0.tgz 
.... 

在這一點上,如果我試圖在Firefox中加載頁面,那麼它會一直保持旋轉狀態,並且永不加載頁面。

所以,我從無線變爲有線,終於拿到了這個:

atom_git$ script/clean 
atom_git$ script/build 
Node: v4.0.0 
npm: v2.14.2 
Installing build modules... 
=> Took 94239ms. 

Installing apm... 
=> Took 67760ms. 

Deleting old packages... 
=> Took 418ms. 

Installing modules ✓ 
Installing [email protected] ✓ 
Installing [email protected] ✓ 
Installing [email protected] ✓ 
Installing [email protected] ✓ 
Installing [email protected] ✓ 
Installing [email protected] ✓ 
Installing [email protected] ✓ 
Installing [email protected] ✓ 
Installing [email protected] ✓ 
Installing [email protected] ✓ 
Installing [email protected] ✓ 
Installing [email protected] ✓ 
Installing [email protected] ✓ 
Installing [email protected] ✓ 
Installing [email protected] ✓ 
Installing [email protected] ✓ 
Installing [email protected] ✓ 
Installing [email protected] ✓ 
Installing [email protected] ✓ 
Installing [email protected] ✓ 
Installing [email protected] ✓ 
Installing [email protected] ✓ 
Installing [email protected] ✓ 
Installing [email protected] ✓ 
Installing [email protected] ✓ 
Installing [email protected] ✓ 
Installing [email protected] ✓ 
Installing [email protected] ✓ 
Installing [email protected] ✓ 
Installing [email protected] ✓ 
Installing [email protected] ✓ 
Installing [email protected] ✓ 
Installing [email protected] ✓ 
Installing [email protected] ✓ 
Installing [email protected] ✓ 
Installing [email protected] ✓ 
Installing [email protected] ✓ 
Installing [email protected] ✓ 
Installing [email protected] ✓ 
Installing [email protected] ✓ 
Installing [email protected] ✓ 
Installing [email protected] ✓ 
Installing [email protected] ✓ 
Installing [email protected] ✓ 
Installing [email protected] ✓ 
Installing [email protected] ✓ 
Installing [email protected] ✓ 
Installing [email protected] ✓ 
Installing [email protected] ✓ 
Installing [email protected] ✓ 
Installing [email protected] ✗ 
Package version: 0.88.0 not found 

...現在這裏的構建過程停止。我認爲該死的 - 我如何從源代碼構建,現在他們依靠互聯網上的軟件包繼續被刪除?但後來我瀏覽了一下,發現https://github.com/atom/tabs/releases/tag/v0.88.0 - 很棒;所以我想這:

cd /tmp 
wget https://github.com/atom/tabs/archive/v0.88.0.zip 
unzip v0.88.0.zip 

cd /path/to/atom_git 
mv /tmp/tabs-0.88.0 ./node_modules/ 

...並再次試圖構建:

atom_git$ script/build 
Node: v4.0.0 
npm: v2.13.3 
Installing build modules... 
=> Took 3473ms. 

Installing apm... 
=> Took 1122ms. 

Deleting old packages... 
Removing tabs-0.88.0 ✓ 
=> Took 1290ms. 

Installing modules ✓ 
Installing [email protected] ✗ 
Package version: 0.88.0 not found 

該死的 - 它發現[email protected],它刪除它!我如何說服現在的構建過程,不要在線尋找[email protected],而是使用我提供給它的那個,所以構建腳本可以繼續構建?

回答

0

好吧,我想我有一個地方;

第一個問題是,當我解壓縮v0.88.0.zip時,我得到一個名爲tabs-0.88.0的目錄,我直接轉到atom_git/node_modules/。但是,./script/bootstrap告訴我們「刪除舊包...「是由於apm clean,如果我們所說的幫助:

atom_git$ ./apm/node_modules/atom-package-manager/bin/apm clean --help 
Usage: apm clean 
Deletes all packages in the node_modules folder that are not referenced 
as a dependency in the package.json file. 

阿 - 和package.json我​​源包含:

atom_git$ grep tabs package.json 
    "tabs": "0.88.0", 

因此,期望該文件夾被命名爲tabs - 和NOT tabs-0.88.0,所以做正確的事情是:

cd /tmp 
wget https://github.com/atom/tabs/archive/v0.88.0.zip 
unzip v0.88.0.zip 

cd /path/to/atom_git 
mv /tmp/tabs-0.88.0 ./node_modules/tabs 

然後我得到了同樣的問題, tree-view;所以我做了

cd /tmp 
wget https://github.com/atom/tree-view/archive/v0.198.1.zip 
unzip v0.198.1.zip 

cd /path/to/atom_git 
mv /tmp/tree-view-0.198.1 ./node_modules/tree-view 

這使得構建持續到:

Running "compile-packages-slug" task 
>> tabs: No README data 
Warning: Task "compile-packages-slug" failed. Use --force to continue. 

解決方案,這是在:NPM - How to fix "No readme data" - 原來,現在的插件的package.json必須包含readme關鍵,所以我加了這樣的事情atom_git/node_modules/tabs/package.json

... 
    "dependencies": { 
    "temp": "~0.8.1", 
    "underscore-plus": "1.x" 
    }, 
    "readme": "# Tabs package", 
    "readmeFilename": "README.md", 
    "devDependencies": { 
... 

...和同爲tree-view一個 - 最後構建完成後,還工作了script/grunt mkdeb,創建了一個64位的deb;這個deb是可以安裝的--123007137186​​終於爲我運行了(它仍然在第一次啓動時吐出一個錯誤,我沒有記錄(編輯:它可能是「Uncaught TypeError: Cannot read property 'length' of undefined」) - 但第二次啓動並沒有導致任何錯誤,所以我想現在是OK)...

編輯:不,這是不正常,它給了我Uncaught TypeError: Cannot read property 'length' of undefined每次我鍵入鍵...

什麼是浪費時間,這是.. 。