情弱ログ

参考にならないので当てにしないでください

セキュキャンに落ちた解答を晒す

んなもん誰が読むんじゃ
まずはセキュリティ・キャンプ合格者のみなさんおめでとうございます。僕は残念ながら落ちてしまいましたが、部内に一人合格者がいたので全滅は免れました。KK君おめでとう&頑張れ。
年齢的に最後のチャンスだったので、落ちた時はかなりへこみましたが、これを期に他の勉強会等にも積極的に参加していきたいです。

今回晒す解答は実際に提出したものをそのまま貼り付けています。
反面教師として来年度以降誰かの参考になったら幸いです。
尚、選択問題2,5,6,9,11に取り組みました。

続きを読む

Gnome3のアプリケーション一覧を汚染された

winetricksでゴニョゴニョといくつかパッケージを入れていたら、Gnomeのアプリケーション一覧(Activities→Show Applications)がバッテン印のアプリケーションに汚染された。
アプリケーション一覧からアプリを起動することはあまりないが、見た目がよろしくない。

rm -rf ~/.local/share/desktop-directories/*
rm -rf ~/.local/share/applications/wine*

して一度ログアウトしたら消えた。
wineのアイコンも消えたが、コンソール以外から使うことはないから問題ない。

ちゃんとfind ~ .name .desktopして不要なものを見極めてから消すことをおすすめ。

yosemite上のGentoo/Prefixでmedia-libs/libcanberraのemergeがコケる

誰かバグレポート書いて案件その3。
とりあえず

% emerge libcanberra

すると

canberra-gtk-module.c:28:22: error: gdk/gdkx.h: No such file or directory
canberra-gtk-module.c: In function 'window_get_desktop':
canberra-gtk-module.c:303: error: 'Atom' undeclared (first use in this function)
canberra-gtk-module.c:303: error: (Each undeclared identifier is reported only once
canberra-gtk-module.c:303: error: for each function it appears in.)
canberra-gtk-module.c:303: error: expected ';' before 'type_return'
canberra-gtk-module.c:315: warning: implicit declaration of function 'XGetWindowProperty'
canberra-gtk-module.c:315: warning: implicit declaration of function 'GDK_DISPLAY_XDISPLAY'
canberra-gtk-module.c:315: warning: implicit declaration of function 'GDK_WINDOW_XID'
canberra-gtk-module.c:316: warning: implicit declaration of function 'gdk_x11_get_xatom_by_name_for_display'
canberra-gtk-module.c:317: error: 'False' undeclared (first use in this function)
canberra-gtk-module.c:317: error: expected ')' before numeric constant
canberra-gtk-module.c:317: error: 'type_return' undeclared (first use in this function)
canberra-gtk-module.c:319: error: 'Success' undeclared (first use in this function)
canberra-gtk-module.c:322: error: expected ')' before numeric constant
canberra-gtk-module.c:329: error: 'None' undeclared (first use in this function)
canberra-gtk-module.c:330: warning: implicit declaration of function 'XFree'
canberra-gtk-module.c: In function 'display_get_desktop':
canberra-gtk-module.c:336: error: 'Atom' undeclared (first use in this function)
canberra-gtk-module.c:336: error: expected ';' before 'type_return'
canberra-gtk-module.c:348: warning: implicit declaration of function 'DefaultRootWindow'
canberra-gtk-module.c:350: error: 'False' undeclared (first use in this function)
canberra-gtk-module.c:350: error: expected ')' before numeric constant
canberra-gtk-module.c:350: error: 'type_return' undeclared (first use in this function)
canberra-gtk-module.c:352: error: 'Success' undeclared (first use in this function)
canberra-gtk-module.c:355: error: expected ')' before numeric constant
canberra-gtk-module.c:363: error: 'None' undeclared (first use in this function)
canberra-gtk-module.c: In function 'window_is_xembed':
canberra-gtk-module.c:370: error: 'Atom' undeclared (first use in this function)
canberra-gtk-module.c:370: error: expected ';' before 'type_return'
canberra-gtk-module.c:376: error: expected ';' before 'xembed'
canberra-gtk-module.c:386: error: 'xembed' undeclared (first use in this function)
canberra-gtk-module.c:392: error: 'False' undeclared (first use in this function)
canberra-gtk-module.c:392: error: 'type_return' undeclared (first use in this function)
canberra-gtk-module.c:394: error: 'Success' undeclared (first use in this function)
canberra-gtk-module.c:408: error: 'None' undeclared (first use in this function)

こんなエラーが出てくる。
面倒なので(あと昨日の夜に寝ぼけながらやったせいでほとんど覚えてないので)解決方法だけ乗せると

% LDFLAGS="-L/Users/vicco/Gentoo/usr/lib -L/usr/local/lib" CPPFLAGS="-I/Users/vicco/Gentoo/usr/include -I/usr/local/include/gtk-2.0 -I/usr/local/lib/gtk-2.0/include" CC=clang CXX=clang++ ebuild ~/Gentoo/usr/portage/media-libs/libcanberra/libcanberra-0.30-r4.ebuild unpack
% vim ~/Gentoo/var/tmp/portage/media-libs/libcanberra-0.30-r4/work/libcanberra-0.30/configure.ac

で117行目から

CC_CHECK_FLAGS_APPEND([with_ldflags], [LDFLAGS], [\
        -Wl,--as-needed \
        -Wl,--gc-sections])

の部分をコメントアウト。clangでは--as-neededと--gc-sectionsはunsupported optionとのこと。
あとは

% LDFLAGS="-L/Users/vicco/Gentoo/usr/lib -L/usr/local/lib" CPPFLAGS="-I/Users/vicco/Gentoo/usr/include -I/usr/local/include/gtk-2.0 -I/usr/local/lib/gtk-2.0/include" CC=clang CXX=clang++ ebuild ~/Gentoo/usr/portage/media-libs/libcanberra/libcanberra-0.30-r4.ebuild configure
% LDFLAGS="-L/Users/vicco/Gentoo/usr/lib -L/usr/local/lib" CPPFLAGS="-I/Users/vicco/Gentoo/usr/include -I/usr/local/include/gtk-2.0 -I/usr/local/lib/gtk-2.0/include" CC=clang CXX=clang++ ebuild ~/Gentoo/usr/portage/media-libs/libcanberra/libcanberra-0.30-r4.ebuild compile
% LDFLAGS="-L/Users/vicco/Gentoo/usr/lib -L/usr/local/lib" CPPFLAGS="-I/Users/vicco/Gentoo/usr/include -I/usr/local/include/gtk-2.0 -I/usr/local/lib/gtk-2.0/include" CC=clang CXX=clang++ ebuild ~/Gentoo/usr/portage/media-libs/libcanberra/libcanberra-0.30-r4.ebuild install
% LDFLAGS="-L/Users/vicco/Gentoo/usr/lib -L/usr/local/lib" CPPFLAGS="-I/Users/vicco/Gentoo/usr/include -I/usr/local/include/gtk-2.0 -I/usr/local/lib/gtk-2.0/include" CC=clang CXX=clang++ ebuild ~/Gentoo/usr/portage/media-libs/libcanberra/libcanberra-0.30-r4.ebuild qmerge

(毎回LDFLAGSとか指定する必要は多分無い)
Gentoo/Prefix上のライブラリとbrewで突っ込んだライブラリを使ったせいでとてもカオス。
今後アップデートがあった時にとても面倒くさそう。

yosemite上のGentoo/Prefixでx11-libs/gtk+のemergeがコケる

さっきの記事と似たような内容
とりあえずそのままemergeするとこんな感じのエラーが大量に出てコケる。

In file included from /System/Library/Frameworks/AppKit.framework/Headers/AppKit.h:207,
                 from /Users/vicco/Gentoo/var/tmp/portage/x11-libs/gtk+-3.14.8/work/gtk+-3.14.8/gdk/quartz/gdkquartz.h:23,
                 from /Users/vicco/Gentoo/var/tmp/portage/x11-libs/gtk+-3.14.8/work/gtk+-3.14.8/gdk/quartz/gdkprivate-quartz.h:26,
                 from /Users/vicco/Gentoo/var/tmp/portage/x11-libs/gtk+-3.14.8/work/gtk+-3.14.8/gdk/quartz/gdkcursor-quartz.c:25:
/System/Library/Frameworks/AppKit.framework/Headers/NSCollectionView.h:114: error: expected a property attribute before 'strong'

原因はさっきの記事と同じでgccコンパイルするとよく分からないヘッダファイルで構文エラーが出るため。とりあえずclangでコンパイルするために

% CC=clang CXX=clang++ emerge gtk+

する。
けれども今度は

checking for GLIB - version >= 2.41.2... no
*** Could not run GLIB test program, checking why...
*** The test program failed to compile or link. See the file config.log for the
*** exact error that occured. This usually means GLIB is incorrectly installed.
configure: error:
*** GLIB 2.41.2 or better is required. The latest version of
*** GLIB is always available from ftp://ftp.gtk.org/pub/gtk/.

こんなエラーが出てきてconfigure phaseでコケる。
emerge -s glib(当然eixでも良い)すると

*  dev-libs/glib
      Latest version available: 2.42.1
      Latest version installed: 2.42.1
      Size of files: 8,708 KiB
      Homepage:      http://www.gtk.org/
      Description:   The GLib library of C routines
      License:       LGPL-2+

になっているため、間違いなくGLIBのバージョンは2.41.2より高い。
原因としては-lintlというリンカオプションでライブラリが見つからずにコケているようなので、とりあえずgettextをemergeして(すでにあるなら不要)

% emerge gettext
% LDFLAGS=-L/Users/vicco/Gentoo/usr/lib CPPFLAGS=-I/Users/vicco/Gentoo/usr/include CC=clang CXX=clang++ emerge gtk+

で解決。

yosemite上のGentoo/Prefixでsys-apps/dbusのemergeがコケる

OSX 10.10.2な環境でsys-apps/dbusをemergeするとconfigure phaseでコケる。
configure: error: launchd support explicitly enabled but not available
こんな感じのエラーログが出る。

原因はlaunch.h内でインクルードしているxpc/base.hでclangでしか使えないプリプロセッサディレクティブ(__has_extension(),__has_feature())を使っているため。

要するにコンパイラgccからclangに代えてやればコンパイルは通るので、

% CC=clang CXX=clang++ emerge sys-apps/dbus

してやればコンパイル出来る。

次回以降もclangを指定してやらないとコンパイルが失敗するため、

% echo -e "CC=clang\nCXX=clang++" >> ${prefix_root}/etc/portage/env/clang
% echo -e "sys-apps/dbus clang" >> ${prefix_root}/etc/portage/package.env

(もちろん適宜変更してください)
すると次回以降もclangでコンパイルされる(はず)。
参考:Clang - Gentoo Wiki

これはバグレポート案件なのだろうか。
英語が出来ないのでバグレポート書いてないんですが誰か暇な人いたら書いてくれませんか。

早くGentoo/Prefixでemerge mikutterしたい。

emerge時のdependency conflict例①

# emerge -pvuDN @world

とかしたらこんな感じのconflictが起きた。

 

x11-base/xorg-server:0

(x11-base/xorg-server-1.15.99.902-r2:0/1.15.99.902::gentoo, ebuild scheduled for merge) conflicts with
x11-base/xorg-server:0/1.15.1= required by (x11-drivers/xf86-input-mouse-1.9.0:0/0::gentoo, installed)
<x11-base/xorg-server-1.15.99 required by (x11-drivers/nvidia-drivers-337.19:0/0::gentoo, installed)
x11-base/xorg-server:0/1.15.1= required by (x11-drivers/xf86-input-evdev-2.8.4:0/0::gentoo, installed)
x11-base/xorg-server:0/1.15.1= required by (x11-drivers/xf86-input-keyboard-1.7.0:0/0::gentoo, installed)

 

dev-libs/boost:0

(dev-libs/boost-1.55.0-r1:0/1.55.0::gentoo, ebuild scheduled for merge) conflicts with
>=dev-libs/boost-1.46:0/1.52= required by (app-office/libreoffice-bin-4.2.3.3-r1:0/0::gentoo, installed)
>=dev-libs/boost-1.51.0:0/1.52= required by (dev-libs/liborcus-0.5.1:0/0.5::gentoo, installed)
dev-libs/boost:0/1.52 required by (app-office/libreoffice-bin-4.2.3.3-r1:0/0::gentoo, installed)
dev-libs/boost:0/1.52= required by (dev-cpp/libcmis-0.4.1:0.4/0.4::gentoo, installed)
dev-libs/boost:0/1.52= required by (app-text/libetonyek-0.0.3:0/0::gentoo, installed)
dev-libs/boost:0/1.52= required by (dev-libs/libixion-0.5.0:0/0.5::gentoo, installed)

 

app-office/libreoffice-l10n:0

(app-office/libreoffice-l10n-4.2.4.2:0/0::gentoo, ebuild scheduled for merge) conflicts with
=app-office/libreoffice-l10n-4.2.3.3* required by (app-office/libreoffice-bin-4.2.3.3-r1:0/0::gentoo, installed)

 

app-text/poppler:0

(app-text/poppler-0.26.1:0/46::gentoo, ebuild scheduled for merge) conflicts with
app-text/poppler:0/44=[cxx,jpeg,lcms,tiff,xpdf-headers(+)] required by (net-print/cups-filters-1.0.53:0/0::gentoo, installed)
>=app-text/poppler-0.16:0/44=[cairo,utils] required by (app-misc/tracker-0.16.4:0/16::gentoo, installed)
>=app-text/poppler-0.12.3-r3:0/44= required by (app-text/texlive-core-2013-r1:0/0::gentoo, installed)
app-text/poppler:0/44 required by (app-office/libreoffice-bin-4.2.3.3-r1:0/0::gentoo, installed)
>=app-text/poppler-0.16:0/44=[xpdf-headers(+),cxx] required by (app-office/libreoffice-bin-4.2.3.3-r1:0/0::gentoo, installed)
>=app-text/poppler-0.24:0/44=[cairo] required by (app-text/evince-3.10.3:0/evd3.4-evv3.3::gentoo, installed)
app-text/poppler:0/44=[xpdf-headers(+)] required by (dev-tex/luatex-0.76.0:0/0::gentoo, installed)

続きを読む